-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Signal Passing to Component in Array #280
Comments
I actually solved this issue but raised another issue. Apparently the signals don't update if a component was lazy loaded (React.lazy). My components were hence why the the problem happened before. But if code-splitting and lazy-loading seem like the route to go with, how can one use Signals with a lazy-loaded component? |
I am having the same issue. I am rendering lazily loaded components as pages, and Signals are not working as intended. (I will provide a reproduction soon, if needed) Are there any workarounds? |
I wasn't proud of this workaround and may not be helpful with code-splitting or bundle size, but I created a wrapper component. The wrapper (or parent) component would use the regular The component being lazily loaded would be the wrapper component and when mounted, that parent component would regularly import the actual component being used. The signals are all inside the actual component and they would not be used directly in a component being lazily loaded. (If I have time, I will try to create an example) |
Initially, I had a map set up to lay out my components in React and was using Signals to pass data from the top level. However, none of the data derived from the Signals in the children components were updating on changes. Once I took out the mapping of components and explicitly wrote out the layout at the parent level, Signals were working normal again. Is there some sort of block that happens with an array but not with manually writing out the components?
The text was updated successfully, but these errors were encountered: