Moon
Moon

Reputation: 22575

How to stop react router executing itself for universal react?

I'm trying to render Redux + Webpack in PHP. My current workflow is as simple as below.

  1. Compile ES6 into js using babel
  2. Use PHP V8 classes to include scripts from step #1
  3. Render contents
  4. Include javascripts used in #1 with script tags.

Everything works fine, except that the included script in #4 re-renders the same view since the route matches. In the route, I have the following configuration.

<Provider store={store}> <div style={{ height: '100%' }}> <Router history={browserHistory} children={routes} /> </div> </Provider>

Is there a way to pass a parameter to the Router component to register routes, but not execute them?

Upvotes: 1

Views: 243

Answers (0)

Related Questions