jpudysz / react-native-unistyles

Level up your React Native StyleSheet
https://unistyl.es
MIT License
1.42k stars 40 forks source link

feat: export UniStyle(View|Text|Image) types #249

Closed yzhe554 closed 2 months ago

yzhe554 commented 2 months ago

Summary

I want to create some reusable Object and type them correctly

type Font = {
    [key: string]: UnistyleText
}

export const fonts: Font = {
    body: {
        fontSize: 16,
        fontWeight: 400,
        lineHeight: 24
    }
}

const stylesheet = createStyleSheet(theme => ({
  body: {
    ...fonts.body
  }
}));

It throws error if UnistyleText isn't used

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-unistyles-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 19, 2024 0:43am
yzhe554 commented 2 months ago

Hey @jpudysz, if this change makes sense, can we get a quick release? I am happy to take any better alternative solution.

yzhe554 commented 2 months ago

@jpudysz Fixed the linting issue. Thank you.