A
A
AZshar2020-07-30 14:46:26
JavaScript
AZshar, 2020-07-30 14:46:26

How to prevent react-native-navigation by wix with mobx from multiple screen rendering?

The essence of the problem is that when using store on the screen, with each new opening of the screen, the number of its renders increased by 1, that is, the first time you go to this screen, the render happens 1 time, when you go to the screen again, 2 times, and so on. Can be who faced it? Thank you all in advance for your replies

Navigation.registerComponent(
        'Screen',
        () => props => <Provider
            orderStore={OrderStore}
        >
            <ScreenItem {...props}/>
        </Provider>
    );

Navigation.events().registerAppLaunchedListener(() => {
    Navigation.setRoot({
        root: {
            stack : {
                id: 'MainStack',
                children : [
                    {
                        component: {
                            name: 'Splash',
                        },
                    }
                ]
            },
        },
    });
});

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question