Last updated on January 10, 2026

StyleSheet

Edit

In NativeWind v4, the StyleSheet is exported from react-native-css-interop (and re-exported from nativewind). It provides internal methods used by the build system and runtime.

Color Scheme Management

To set or toggle the color scheme, use the useColorScheme() hook:

import { useColorScheme } from "nativewind";
 
function MyComponent() {
  const { colorScheme, setColorScheme, toggleColorScheme } = useColorScheme();
 
  return (
    <Text onPress={() => toggleColorScheme()}>
      {`The color scheme is ${colorScheme}`}
    </Text>
  );
}

Internal Methods

The StyleSheet object exposes the following methods, primarily used internally by the build system:

MethodDescription
registerCompiled(options)Registers compiled CSS data from the Metro transform
getFlag(name)Retrieves a build flag (e.g. darkMode strategy)
getGlobalStyle(name)Retrieves a registered global style rule

These methods are not intended for direct use in application code.

On this page