1.2.1 • Published 8 days ago
nuomi-native v1.2.1
介绍
基于nuomi和react-navigation开发的react-native数据流解决方案。
安装
yarn add nuomi-native
使用
import { Text } from 'react-native';
import { NuomiNative, useConnect } from 'nuomi-native';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
const Stack = createStackNavigator();
function HomeLayout() {
const [{ count }, dispatch] = useConnect();
const onPress = () => {
dispatch('@update', {
count: count + 1,
});
};
return <Text onPress={onPress}>{count}</Text>;
}
function Home() {
return (
<NuomiNative state={{ count: 0 }}>
<HomeLayout />
</NuomiNative>
)
}
function Profile() {
return <Text>Profile</Text>
}
function App() {
return (
<Stack.Navigator>
<Stack.Screen name="Home" component={Home} />
<Stack.Screen name="Profile" component={Profile} />
</Stack.Navigator>
);
}
1.2.1
8 days ago
1.2.0
11 days ago
1.1.1
11 months ago
1.1.0
11 months ago
1.0.1
11 months ago
1.0.1-alpha.9
11 months ago
1.0.1-alpha.8
11 months ago
1.0.1-alpha.7
11 months ago
1.0.1-alpha.2
11 months ago
1.0.1-alpha.1
11 months ago
1.0.1-alpha.0
11 months ago
1.0.1-alpha.6
11 months ago
1.0.1-alpha.5
11 months ago
1.0.1-alpha.4
11 months ago
1.0.1-alpha.3
11 months ago
1.0.0-alpha.0
11 months ago
1.0.1-alpha.15
11 months ago
1.0.1-alpha.14
11 months ago
1.0.1-alpha.13
11 months ago
1.0.1-alpha.12
11 months ago
1.0.1-alpha.11
11 months ago
1.0.1-alpha.10
11 months ago
0.8.19
4 years ago
0.8.18
4 years ago
0.1.1
4 years ago
0.1.0
4 years ago