Shyam Kumar
Shyam Kumar

Reputation: 158

Communication between react apps

I want to pass PROPS from one react app to another react app.

I know about sharing props between the components and usage of redux and flux.

Is there any way or any external library which does this functionality?

Upvotes: 0

Views: 752

Answers (1)

agenthunt
agenthunt

Reputation: 8678

Something like this.

In React App 1

  <button onClick={() => window.replace('http://app2.com/showDetails/zce1ifkfhy')}> Show Details </button>

In React App 2

  <Router>
     ....
      <Route
        path="/showDetails/:id"
        component={ShowDetailsComponent}
      />
  </Router>

ShowDetailsComponent

const ShowDetailsComponent = ({ match }) => (
  <div>
    <h3>Id from app1: {match.params.id}</h3>
  </div>
);

Upvotes: 2

Related Questions