Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教下,有没有app.tsx是hooks mobx版本的项目案例 #8334

Closed
lichenglong-blog opened this issue Dec 21, 2020 · 3 comments
Closed
Labels
enhancement New feature or request

Comments

@lichenglong-blog
Copy link

这个特性解决了什么问题?

摆脱class的组件残留

这个 API 长什么样?

完全是hooks版本

@taro-bot2 taro-bot2 bot added the enhancement New feature or request label Dec 21, 2020
@Chen-jj
Copy link
Contributor

Chen-jj commented Dec 21, 2020

手动改下吧,保证 app 入口文件渲染了 props.children 就行。

@lichenglong-blog
Copy link
Author

lichenglong-blog commented Dec 21, 2020

手动改下吧,保证 app 入口文件渲染了 props.children 就行。

老哥请教下,我没有思路,怎么把store传入props.children参数,难道我要整一个路由模块么?app.tsx都已经是函数式组件了,怎么拿到 props.children?

@ZakaryCode
Copy link
Contributor

function App({ children }) {
  return <Provider store={store}>
    {children}
  </Provider>
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants