Remove support for "render" prop and only support "children"
See original GitHub issueRight now we support both <Downshift render={() => <div />} />
and <Downshift>{() => <div />}</Downshift>
. It’s kinda nice, but now that React has adopted the children version with the new context API it’d be good to just go with children
for cohesion. In v2.0.0 we’ll drop support for the prop called render.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:14
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Remove support for "render" prop and only support "children"
Right now we support both } /> and {() => } . It's kinda nice, but now that React has adopted the children...
Read more >javascript - React - Remove prop from child - Stack Overflow
I just ran into this issue. You can just create a new element and use the old element's type and props you want...
Read more >React Reference Guide: Render props - LogRocket Blog
An all-in-one reference guide on render props in React, including how to implement render props, how to implement HOCs, and more.
Read more >The mystery of React Element, children, parents and re-renders
Looking into what is React Element, exploring various children vs parents relationship in React, and how they affect re-renders.
Read more >A Complete Guide To props.children In React - codeburst
Essentially, props.children is a special prop, automatically passed to every component, that can be used to render the content included between the opening ......
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
I would love to do it. Also suggest that we should add a nice informational message in console in case if there is a ‘render’ prop, just like React does in various cases.
@blocka thanks, but I was merely trying to point out that there could be some confusion caused by this due to how broadly “prop” is used to describe things and that not everyone would know that it could refer to “function as a child” (this is only mentioned in one small paragraph in the article and there is no downshift documentation to say the “prop called render” which is demonstrated in the linked article is not supported)