Skip to content

What's the overhead of Composite Components? #12

Answered by sammy-SC
AndreiCalazans asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @AndreiCalazans,

interesting question! I'll share my understanding of composite components.

Context API is special. It is not a composite component. Context does has performance implications. Specifically for updates as it becomes more laborious to identify changes in the fiber tree. Component is no longer just a function of state and props, but context is added to the mix. Someone with React knowledge is better suited to answer this in depth but I thought I would share my understanding.

Composite component only really adds extra function call. As React executes render function, it will see return value of the render function is another function that it needs to execute. I would say t…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@AndreiCalazans
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by cortinico
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants