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!: only halt traverseFiber on boolean, harden Fiber types #5

Closed CodyJasonBennett closed 2 years ago

CodyJasonBennett commented 2 years ago

This PR ensures that traverseFiber will only halt when true is passed to a selector. This forces selectors to return a boolean and will continue as an effect in any other case, including if a method returns a truthy value.

Additionally, Fiber types are hardened to show interoperability, and useContainer now returns Container.containerInfo by default. As a result, the Container type is removed. A new type ContainerInstance represents the internal container instance.