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

关于PreLoadReactActivity的onCreate方法中super.onCreate()耗时的一些疑问 #8

Open
BBBOND opened this issue Sep 20, 2017 · 0 comments

Comments

@BBBOND
Copy link

BBBOND commented Sep 20, 2017

在PreLoadReactActivity的onCreate方法中调用了mPreLoadReactDelegate.onCreate();
我看出了您的用意,是为了让activity渲染缓存的ReactRootView。

不过经我试验,由于继承自ReactActivity,在super.onCreate()方法中也有getPlainActivity().setContentView(mReactRootView)方法,对rn进行加载渲染,虽然在之后的方法中您会对ContentView进行覆盖,但是ReactActivity在onCreate方法中的操作已经执行,不可避免也会带来一些耗时的操作。

由于本人所做项目生成的jsbundle较大,因此加载的耗时极为明显。本人对该方法进行了一些改写,从另外一个角度进行解决。稍后对代码进行整理后,再贴出来求证。

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

No branches or pull requests

1 participant