Render Props React Code
Sources:
WARNING
Render props are used in modern React, but aren’t very common. For many cases, they have been replaced by custom Hooks.
Overview
About
The term “render prop” refers to a technique for sharing code between React components using a prop whose value is a function.
See Also: as Prop
Compared to the as
prop, render
props has the disadvantage of adding more nesting into the code. On the other hand, you have more control over the components and props added.
Code Snippet
src/components/Example.tsx
Details
See Also
-
React (Tool)
Appendix
Note created on 2024-04-30 and last modified on 2024-04-30.
Backlinks
(c) No Clocks, LLC | 2024