mirror of
https://github.com/zhigang1992/nativewind.git
synced 2026-06-10 23:58:57 +08:00
35 lines
863 B
Markdown
35 lines
863 B
Markdown
## Thats it 🎉
|
|
|
|
Start writing code!
|
|
|
|
Without the Babel transform you will need to wrap your components in the [styled higher-order component](../api/styled)
|
|
|
|
```diff
|
|
import { StatusBar } from 'expo-status-bar';
|
|
import React from 'react';
|
|
- import { StyleSheet, Text, View } from 'react-native';
|
|
+ import { Text, View as RNView } from 'react-native';
|
|
+ import { styled } from 'nativewind';
|
|
|
|
+ const View = styled(RNView)
|
|
|
|
export default function App() {
|
|
return (
|
|
- <View style={styles.container}>
|
|
+ <View className="flex-1 items-center justify-center bg-white">
|
|
<Text>Open up App.js to start working on your app!</Text>
|
|
<StatusBar style="auto" />
|
|
</View>
|
|
);
|
|
}
|
|
|
|
- const styles = StyleSheet.create({
|
|
- container: {
|
|
- flex: 1,
|
|
- backgroundColor: '#fff',
|
|
- alignItems: 'center',
|
|
- justifyContent: 'center',
|
|
- },
|
|
- });
|
|
```
|