Pity attempts to make meteor faster look like they are ignored

side note: why do you use the router in such a weird way? you can use the exact same code on server and client:

// Routes.jsx 
export default () => (
<Switch>
			<Route exact path="/" render={() => <App1 page="Index"></App1>} />
			<Route exact path="/howItWorks" render={() => <App page="HowItWorks"></App>} />
			<Route exact path="/registerInfo" render={() => <App page="RegisterInfo"></App>} />
	  </Switch>
)


// server.jsx
import Routes from '../common/Routes.jsx'
onPageLoad((sink) => {  
  const context = {};
  sink.renderIntoElementById('root', renderToString( <StaticRouter location={props.location} context={context}><Routes /></StaticRouter>));
})


// client.jsx
import Routes from '../common/Routes.jsx'

onPageLoad(async sink => {
  ReactDOM.hydrate(
    < BrowserRouter><Routes /></BrowserRouter>,
    document.getElementById("root")
  );
});

```
1 Like