react-native-zephyr
react-native-zephyr copied to clipboard
Remove `StyleProvider`
What is this?
This PR removes the need to wrap your app in StyleProvider
. The reason for this change is twofold:
- It's easier to setup if you don't have to wrap your app. I like that, and then dark mode just sort of "magically" works without the provider.
- I'm working toward a set of response utilities, where you can apply "classes" based on screen size. This will require a top-level WindowDimensions listener. I'd like to keep things as performant as possible, and not have to deal with Context values changing and triggering cascading re-renders.
This PR also adds a bunch of cleanup around tests.
Damn, just now seeing that RNW doesn't support Appearance.addChangeListener
, so this is going to fail for RNW 😢
I'm torn on this. I really like this change to the API, but not supporting RNW is a real downside.
UPDATE!
Looks like Appearance.addChangeListener
does exist, it just doesn't conform to RN's new API for change listeners (e.g., returning a remove
method from the subscription). I've created a PR for RNW to support this.
LGTM? 🥇