app.tsx 941 B

123456789101112131415161718192021222324252627282930313233
  1. import { Component, PropsWithChildren } from 'react'
  2. import './app.scss'
  3. import './context/locales/index'
  4. import { Provider } from 'react-redux'
  5. import store from './store/store'
  6. import { View } from '@tarojs/components'
  7. import GlobalModal from './components/layout/GlobalModal'
  8. // import 'taro-ui/dist/style/index.scss'
  9. const App: React.FC<PropsWithChildren> = ({ children }) => {
  10. return <Provider store={store}>
  11. <View style={{position:'absolute',left:0,right:0,top:0,height:300,backgroundColor:'red'}}/>
  12. {children}
  13. <GlobalModal />
  14. <View style={{position:'absolute',left:0,right:0,top:0,height:300,backgroundColor:'red'}}/>
  15. </Provider>
  16. }
  17. // class App extends Component<PropsWithChildren> {
  18. // componentDidMount () {}
  19. // componentDidShow () {}
  20. // componentDidHide () {}
  21. // // this.props.children 是将要会渲染的页面
  22. // render () {
  23. // return this.props.children
  24. // }
  25. // }
  26. export default App