Skip to main content

Command Palette

Search for a command to run...

Understanding React compound components - LogRocket Blog

Updated
1 min read
Understanding React compound components - LogRocket Blog

melissa g. says:

May 22, 2019 at 2:06 am

Hello!, this is a nice article, It helped me to understand this pattern a little bit better :), just one observation I have, in the code snippet you have in the article:

“`
const Tab = ({ id, children }) => (

{({ changeTab }) => changeTab(id)}>{children}}

);
“`
there is that ” > ” character in the return of the function inside that is confusing (I even thought it was a special new syntax of react…you never know! lol), then I checked the code sandbox provided, and I saw that the function was actually “({ changeTab }) => changeTab(id)}>{children}” which I was able to understand better.

Maybe update the article’s code snippets to make it even clearer to new readers with less React experience,

Thanks!

Reply

More from this blog

Binarydiods

272 posts