React: Run multiple React sub-apps inside one React App

Created on 19 Dec 2018  路  6Comments  路  Source: facebook/react

Hello,

I want to make an application that run multiple React sub-apps.

For example :
I have an independent application Chat.
An independent application Books.
I want to have a single application Books Chat where users can select a book and make a conversation about it.

Books Chat (apps container) call the two applications Books and Chat.
Each application have its own lifecycle.

Is this possible ?
Can I have some how to indications ?

Thanks :)

All 6 comments

Hi, You can linked together but It's not optimal. The problem is that each time the user switches from one app to the other, she will have to download all the dependencies again, even the ones she had downloaded to run the previous app (react, react-dom, and any common dependency).

The closest you can get to this with a CRA setup is to extract independent parts to have their own build system (e.g. using nwb. Then you can host them at some CDN, and put them into index.html of the CRA projects.

Hello ok it is so clear, I began to do that, but how to call each applications, how to do routing ? Is there any specific settings in webpack ?

Know I have two applications hosted at a CDN, I made call into index of the CRA, the remaining thing is how to call and use that applications and my router how it should be, thanks :)

i think just Redux will solve this 馃

Could you please explain more how does Redux solve this ?? Thanks.

Hey there! We use the issue tracker for bug reports and feature requests.

If you have a question, please check our community support resources:
https://facebook.github.io/react/community/support.html

Was this page helpful?
0 / 5 - 0 ratings