Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use useTrackRenders when component is used in the wrapper option #7

Open
jerelmiller opened this issue Nov 4, 2024 · 1 comment

Comments

@jerelmiller
Copy link
Contributor

When using renderStream.render, I am unable to to use components that use the useTrackRenders hook in the wrapper option. As an example, see this test from an Apollo Client bug that I'm working on. I'd like to move the <Suspense /> and <ErrorBoundary /> components to the wrapper option. When doing so however, I see the error:

useTrackRenders: A Render Stream must be created and rendered to track component renders

Ideally useTrackRenders can be used for components in the components passed to render and wrapper. This would also make it easier for more of these complex cases to use rerender to avoid the need to pass that whole component tree again.

@phryneas
Copy link
Member

phryneas commented Nov 5, 2024

Good point. We probably need to swap ParentWrapper and Wrapper for that here:

<ParentWrapper>
<Wrapper>{props.children}</Wrapper>
</ParentWrapper>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants