Skip to content

Commit

Permalink
fix(Toast): 修复 Toast 在 demo 上不能正常显示 fix #143 (#169)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
yaob421123 committed Aug 12, 2021
1 parent 213f6dd commit 331a0f1
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 29 deletions.
59 changes: 31 additions & 28 deletions example/examples/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';
import {SafeAreaView, StatusBar, StyleSheet} from 'react-native';
import { RootSiblingParent } from 'react-native-root-siblings';

import {stackPageData} from './routes';

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

const App = () => {
return (
<SafeAreaView style={styles.block}>
<StatusBar barStyle="dark-content" />
<NavigationContainer>
<Stack.Navigator initialRouteName="Home">
<Stack.Screen
name="Home"
component={require('./Home').default}
options={{
headerTitle: 'Home',
// header: () => null,
}}
/>
{stackPageData.map((props: any, index: number) => {
return (
<Stack.Screen
key={index}
{...props}
// name="Home"
// options={{
// header: () => null
// }}
// component={Home}
/>
);
})}
</Stack.Navigator>
</NavigationContainer>
</SafeAreaView>
<RootSiblingParent>
<SafeAreaView style={styles.block}>
<StatusBar barStyle="dark-content" />
<NavigationContainer>
<Stack.Navigator initialRouteName="Home">
<Stack.Screen
name="Home"
component={require('./Home').default}
options={{
headerTitle: 'Home',
// header: () => null,
}}
/>
{stackPageData.map((props: any, index: number) => {
return (
<Stack.Screen
key={index}
{...props}
// name="Home"
// options={{
// header: () => null
// }}
// component={Home}
/>
);
})}
</Stack.Navigator>
</NavigationContainer>
</SafeAreaView>
</RootSiblingParent>
);
};

Expand Down
2 changes: 1 addition & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ A UI component library based on React Native (Android & iOS).
## Install

```bash
yarn add @uiw/react-native react-native-svg
yarn add @uiw/react-native react-native-svg react-native-root-siblings
```

## Basic Usage
Expand Down
15 changes: 15 additions & 0 deletions packages/core/src/Toast/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ Toast 轻提示

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

组件基于[`react-native-root-siblings`](https://github.com/magicismight/react-native-root-siblings) 插件开发, 当 `react native >= 0.62` 时,需要在程序中插入一个装入容器


```jsx
import { RootSiblingParent } from 'react-native-root-siblings';

export default () => {
return (
<RootSiblingParent>
<App />
</RootSiblingParent>
)
}
```

## 基础示例

```jsx
Expand Down

0 comments on commit 331a0f1

Please sign in to comment.