NervJS / taro

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
https://docs.taro.zone/
Other
35.62k stars 4.8k forks source link

React.cloneElement #5925

Closed keesee closed 4 years ago

keesee commented 4 years ago

不好意思我汉语不太好。 有一个问题。 我找不到Taro.CloneElement. :( Taro有没有?在哪里?

const Renderer = React.cloneElement(
                this.returnRenderer(), 
                { ...this.returnDynamicProps() }
            )

这个怎么做?谢谢 :)

taro-bot[bot] commented 4 years ago

CC @Chen-jj

taro-bot[bot] commented 4 years ago

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

yuche commented 4 years ago

You should use Taro Next, which provides all the React APIs except React.lazy and can use most (e.g. react-redux, mobx-react) React's non-GUI Library directly, with no syntax limitations (e.g. you can't declare two components in one file).

Note that upgrading to Taro Next requires some additional work, most of which is described in migration guide). However, there is currently no translation of this document, but I believe you should be able to find a way around it as well :).

keesee commented 4 years ago

Thanks for the answer. In English : )
Will give Taro Next a shot.

keesee commented 4 years ago

@yuche -- impressive. we have some fairly complex workflows via redux/sagas etc. once I wrote the adapter for Taro.request, all of our core functionality from react dom apps worked in wechat without needing code changes. thanks for your work on this project and the pointers above. :)