We use StyleSheet in almost all components. Generally there are three different approaches to changing component layout with React Native: Direct layout change in the component (e.g. text field) Create a StyleSheet section in each page Create a Global StyleSheet and reference in each component Personally speaking, I do not recommend the first 2 options due to: maintenance and inconsistency approach in design between different components harder to transfer to a new project. with GlobalStyles, you can put on a separate windows for easy view and update as you work on different component apply the dark/light theme to the component directly through GlobalStyles without having to customize it for each page Theme - Dark and Light theme with React Native with iOS, Android, Web, etc. Warning: if you use Expo Debugging, the system will default to Light theme (at least on iOS). Remove Remote Debugging if you want the Dark Theme to show up. In your Navigagor, apply the theme: const scheme = useCol
Comments
Post a Comment