Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Fix br warning #13

Closed
wants to merge 1 commit into from
Closed

Fix br warning #13

wants to merge 1 commit into from

Conversation

lithin
Copy link
Contributor

@lithin lithin commented Jan 29, 2016

When adding html that has a <br> tag in it, react logs the following warning:

Warning: br is a void element tag and must not have children or use props.dangerouslySetInnerHTML. Check the render method of...

I've made a change to the code that cycles through all the children and removes any <br> tags. I'm not sure if this is performant but it does solve the issue. I'd be grateful for any comments :)

@mikenikles
Copy link
Owner

Hi @lithin, thanks for your contribution. I've opened PR #17 that is a more generic approach. There are many other void element tags in HTML besides br. Could you please have a look at #17 and let me know if that makes sense to you?

Thanks

@lithin lithin closed this Feb 3, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants