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

geolessel commented Nov 19, 2019

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 added 2 commits Mar 28, 2018
@geolessel geolessel self-assigned this Nov 19, 2019
@geolessel

This comment has been minimized.

Copy link
Owner Author

geolessel commented Nov 19, 2019

@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!

@andrewmurph

This comment has been minimized.

Copy link
Contributor

andrewmurph commented Nov 19, 2019

@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
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@geolessel geolessel deleted the more-options branch Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.