-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
为什么useEnv中的setEnv要在useEffect中触发? #31
Labels
Comments
确实是的。下个版本的这种固定信息类的接口会直接产出。可以等待一下下个版本。 |
那改的东西不少,我看很多hooks里面都依赖了useEnv |
因为之前跨端都是用env来判断的. 下个版本会走file的模式. xxx.${env}.ts. 这样会减少大部分的env使用 |
这里要注意 |
=。- 只要是不带平台后缀的最后都会兜底会xx.ts. 不过这次更新要限制taro.version >= 330了 |
新版本已经发布. 暂未宣发. 可以开始尝鲜了 传送门 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Question
理论上来说TARO_ENV 在运行的时候就已经确定了环境,但是看useEnv源码的setter却是在useEffect中触发,是否有什么特殊的case要处理,需要这么做?
如果确定是不可变的,那么用useRef来存性能会更好,一些情况下可以少触发一次render。
The text was updated successfully, but these errors were encountered: