Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two ReactJS apps in single page

Tags:

reactjs

Is it possible to have two React apps in single page.

e.g. Two panels:

  • Left panel: ReactJS app A
  • Right panel: ReactJS app B

UPDATE

I am sorry. May be phrased it the wrong way. But I am new to ReactJS and I use the wrong terms. These two apps might be independent. Created by 2 different people not aware of each other. They will not share code.

Like facebook social box with like button and people faces who liked page and same twitter box.

I think it is bit different and two react dom calls create a single new add that attach to two different nodes.

like image 241
user3130782 Avatar asked Sep 04 '26 12:09

user3130782


1 Answers

Yes it is.

Just use a few ReactDOM.render():

ReactDom.render('appA', document.getElementById('#selector_for_app_a'))
ReactDom.render('appB', document.getElementById('#selector_for_app_b'))

UPDATE

Since you slightly modified your question, my answer is going to be modified as well.

Just ask two separate developers to write a code which ends up with lines specified above. First line for the first developed app, second line for second developed app.

You could easily specify where to place embed widgets in your html then, just add <div id="selector_for_app_a"></div> & <div id="selector_for_app_b"></div> correspondingly

like image 130
asiniy Avatar answered Sep 07 '26 03:09

asiniy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!