Skip to content

Commit 331a0f1

Browse files
authored
fix(Toast): 修复 Toast 在 demo 上不能正常显示 fix #143 (#169)
* doc: edit layout * component: add steps component * edit doc clash * doc: add steps doc * component: add timeLine component * doc: add timeLine doc * doc: edit steps doc * fix: 修复toast在demo上不能正常显示 fix #143
1 parent 213f6dd commit 331a0f1

File tree

3 files changed

+47
-29
lines changed

3 files changed

+47
-29
lines changed

example/examples/src/App.tsx

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import {NavigationContainer} from '@react-navigation/native';
33
import {createStackNavigator} from '@react-navigation/stack';
44
import {SafeAreaView, StatusBar, StyleSheet} from 'react-native';
5+
import { RootSiblingParent } from 'react-native-root-siblings';
56

67
import {stackPageData} from './routes';
78

@@ -15,34 +16,36 @@ const styles = StyleSheet.create({
1516

1617
const App = () => {
1718
return (
18-
<SafeAreaView style={styles.block}>
19-
<StatusBar barStyle="dark-content" />
20-
<NavigationContainer>
21-
<Stack.Navigator initialRouteName="Home">
22-
<Stack.Screen
23-
name="Home"
24-
component={require('./Home').default}
25-
options={{
26-
headerTitle: 'Home',
27-
// header: () => null,
28-
}}
29-
/>
30-
{stackPageData.map((props: any, index: number) => {
31-
return (
32-
<Stack.Screen
33-
key={index}
34-
{...props}
35-
// name="Home"
36-
// options={{
37-
// header: () => null
38-
// }}
39-
// component={Home}
40-
/>
41-
);
42-
})}
43-
</Stack.Navigator>
44-
</NavigationContainer>
45-
</SafeAreaView>
19+
<RootSiblingParent>
20+
<SafeAreaView style={styles.block}>
21+
<StatusBar barStyle="dark-content" />
22+
<NavigationContainer>
23+
<Stack.Navigator initialRouteName="Home">
24+
<Stack.Screen
25+
name="Home"
26+
component={require('./Home').default}
27+
options={{
28+
headerTitle: 'Home',
29+
// header: () => null,
30+
}}
31+
/>
32+
{stackPageData.map((props: any, index: number) => {
33+
return (
34+
<Stack.Screen
35+
key={index}
36+
{...props}
37+
// name="Home"
38+
// options={{
39+
// header: () => null
40+
// }}
41+
// component={Home}
42+
/>
43+
);
44+
})}
45+
</Stack.Navigator>
46+
</NavigationContainer>
47+
</SafeAreaView>
48+
</RootSiblingParent>
4649
);
4750
};
4851

packages/core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ A UI component library based on React Native (Android & iOS).
3535
## Install
3636

3737
```bash
38-
yarn add @uiw/react-native react-native-svg
38+
yarn add @uiw/react-native react-native-svg react-native-root-siblings
3939
```
4040

4141
## Basic Usage

packages/core/src/Toast/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@ Toast 轻提示
33

44
一种轻量级反馈/提示,可以用来显示不会打断用户操作的内容,适合用于页面转场、数据交互的等场景中。
55

6+
组件基于[`react-native-root-siblings`](https://github.com/magicismight/react-native-root-siblings) 插件开发, 当 `react native >= 0.62` 时,需要在程序中插入一个装入容器
7+
8+
9+
```jsx
10+
import { RootSiblingParent } from 'react-native-root-siblings';
11+
12+
export default () => {
13+
return (
14+
<RootSiblingParent>
15+
<App />
16+
</RootSiblingParent>
17+
)
18+
}
19+
```
20+
621
## 基础示例
722

823
```jsx

0 commit comments

Comments
 (0)