pmndrs / its-fine

🐶🔥 A collection of escape hatches for React.
https://npmjs.com/its-fine
MIT License
1.05k stars 10 forks source link

refactor!: stateless useFiber, ContextBridge #32

Closed CodyJasonBennett closed 7 months ago

CodyJasonBennett commented 1 year ago

Refactors useFiber and useContextBridge to not depend on our favorite export. traverseFiber is renamed to traverse with ascending moved beyond the selector, and removes FiberProvider and the unused useNearestChild, useNearestParent, and useContextMap hooks.

itsdouges commented 1 year ago

@CodyJasonBennett what's the plan with this? I'm going to spend some time investigating its fine this afternoon. Curious to know if this will come in soon.

Not needing the fiber provider looks like a great change. I'm going to copy this and have a play.

Edit: It doesn't look like it works 100% of the time. Mostly needing to re-render/HMR to find expected meshes. Is it not concurrent mode safe I guess? Let me test without suspending.

Edit (2): Yes that seems to be the problem.

CodyJasonBennett commented 7 months ago

Will backport as a minor release.