Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(react_component): allow html_element and other options #45

Merged
merged 3 commits into from
Nov 25, 2019

Conversation

geolessel
Copy link
Owner

This will allow the user to more precisely configure the rendered HTML output from react_component/3.

html_element

By default, react_component renders the react component inside a div container. If you pass a value to html_element as an option to react_component/3, it will render the component inside the specified HTML element. For example, to render the component in a span instead of a div, you can run

react_component("MyComponent", %{}, html_element: "span")

Other options

Anything else passed into react_component/3 will be passed through directly to the component's HTML output. This could be a class name, styles, or anything else.

react_component("MyComponent", %{aProp: "hello"}, style: "border-bottom: 1px solid #888")

This takes care of the request in #42.

@geolessel geolessel self-assigned this Nov 19, 2019
@geolessel
Copy link
Owner Author

@AndrewMurph @lustrousgorilla Are these changes still ok for you two? Nothing really changed since I last asked in #42 but I thought I'd re-check in with you. Sorry this took so long!

@ajadamur
Copy link
Contributor

@AndrewMurph @lustrousgorilla Are these changes still ok for you two? Nothing really changed since I last asked in #42 but I thought I'd re-check in with you. Sorry this took so long!

Looks fantastic @geolessel ! Thank you 😄

@geolessel geolessel merged commit fbbbf5f into master Nov 25, 2019
@geolessel geolessel deleted the more-options branch November 25, 2019 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants