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

Skip children that aren't Nodes, strings, or numbers #43

Closed
fregante opened this issue Sep 9, 2019 · 0 comments · Fixed by #51
Closed

Skip children that aren't Nodes, strings, or numbers #43

fregante opened this issue Sep 9, 2019 · 0 comments · Fixed by #51

Comments

@fregante
Copy link
Collaborator

fregante commented Sep 9, 2019

ReactDOM.render(
	<div>
		<p>My name is {'John'}</p>
		<p>My name is {1}</p>
		<p>My name is {<i>a Node</i>}</p>
		<p>My name is {<>a DocumentFragment</>}</p>
		<p>My name is {NaN /* rendered because typeof NaN === 'number' */}</p> 

		<p>My name is {false}</p>
		<p>My name is {true}</p>
		<p>My name is {null}</p>
		<p>My name is {undefined}</p>
	</div>,
	document.body
);

Test it on: https://jscomplete.com/playground

Currently dom-chef specifically tests to render falsey values as strings, but I think we should match React's behavior here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant