-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
Components using Array.map to construct children do not satisfy conditions for the transform #552
Comments
After digging into the babel plugin for a little while, it looks like the following happens when using a map:
A naive and not performant solution would be to recursively write to the parent until we hit the root of our program, which should hopefully be just a handful of levels deep. There's probably a better way of solving this, I'd love some feedback from folks more familiar with babel plugins. 😄 |
Yes, we can do it here, until reach parent signals/packages/react-transform/src/index.ts Line 541 in d3935e8
|
I can make a pr. It shouldn't impact performance |
@XantreDev That would be awesome, I'm more than happy to review once you do! |
Using a simple component that maps onto an array, the transform does not see that the children are actually using signals and does not trigger the transform.
Example:
I opened a draft PR adding a test showing the error case: https://github.com/preactjs/signals/pull/551/files#r1552520125
The text was updated successfully, but these errors were encountered: