Last active
April 29, 2022 16:56
-
-
Save mannyanebi/318d59229c8372702351c139d32e450a to your computer and use it in GitHub Desktop.
How to use React.cloneElement and specify types for children prop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{React.cloneElement(children as React.ReactElement<any>, {toggleOpenSidebar})} | |
{React.Children.map(children, (child => React.cloneElement(child as React.ReactElement<any>, {toggleOpenSidebar})))} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment