jpudysz / react-native-unistyles

Level up your React Native StyleSheet

Home Page:https://unistyl.es

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Breakpoints don't work when not using Theme

andylukmawan opened this issue · comments

Description

Breakpoints inside createStylesheet() don't work when the theme is not used / it's not returned as a function

🔴 can't work:

const stylesheet = createStyleSheet({
    container: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: {
            sm: 'cyan',
            md: 'magenta'
        },
    },
};

🟢 working correctly:

const stylesheet = createStyleSheet(() => ({
  container: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: {
            sm: 'cyan',
            md: 'magenta'
        },
    },
}));

Steps to reproduce

  1. Try modif this example
  2. Check switch to potrait & landscape mode on real device or emulator

Snack or a link to a repository (optional)

https://github.com/jpudysz/react-native-unistyles/tree/main/examples/expo

Unistyles version

2.0.0

React Native version

0.73.0

Platforms

Android

Engine

Hermes

Architecture

Paper (old)

Hey 👋

I have found the issue. There was acutally one less dependency in useMemo.

Thanks!

I will release 2.0.1 shortly