1.2.1 • Published 1 year 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
1 year ago
1.2.0
1 year ago
1.1.1
2 years ago
1.1.0
2 years ago
1.0.1
2 years ago
1.0.1-alpha.9
2 years ago
1.0.1-alpha.8
2 years ago
1.0.1-alpha.7
2 years ago
1.0.1-alpha.2
2 years ago
1.0.1-alpha.1
2 years ago
1.0.1-alpha.0
2 years ago
1.0.1-alpha.6
2 years ago
1.0.1-alpha.5
2 years ago
1.0.1-alpha.4
2 years ago
1.0.1-alpha.3
2 years ago
1.0.0-alpha.0
2 years ago
1.0.1-alpha.15
2 years ago
1.0.1-alpha.14
2 years ago
1.0.1-alpha.13
2 years ago
1.0.1-alpha.12
2 years ago
1.0.1-alpha.11
2 years ago
1.0.1-alpha.10
2 years ago
0.8.19
5 years ago
0.8.18
5 years ago
0.1.1
5 years ago
0.1.0
5 years ago