createFragment warning when rendering a Date
See original GitHub issue<p>{new Date()}</p>
Looks to be hitting the typeof object check.
Not sure if it should cast to string or toISOString or just error.
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
When to use React createFragment? - Stack Overflow
Warning : Any use of a keyed object should be wrapped in React.addons.createFragment(object) before being passed as a child. // This array generates...
Read more >API Reference - Roact Documentation
Make sure not to modify elements after they're passed into createFragment ! ... Warning. Using getValue inside a component's render method is dangerous!...
Read more >Variable refers to new Date() can not be a child element. #7988
If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons....
Read more >Fragments - React
A common pattern in React is for a component to return multiple elements. Fragments let you group a list of children without adding...
Read more >uncaught error: objects are not valid as a react child (found
If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
One of our engineers was stuck on this for ages, as the error examples all show very different scenarios.
Perhaps include obj.toString() in the warning if it isn’t [object Object] or some similar heuristic?
Alternatively, what if the warning was for
instanceof Object
and everything else got coerced to a string?@zpao thx for your answer. Tried to reproduce the problem in an simpler environment and the output looks exactly like yours. So my problem is related to some error in my components. Thx for your feedback