title: Express sending custom props to React causing props to flash and disappear upon render
body: <p>I have a server.js file that should get some data from the server and save it in an object called customP. To make things easier for now I'm playing around trying to pass a constant string along with the RouterContext renderProps:</p>
  
  <p><strong>server.js</strong></p>
  
  <pre><code>markup = renderToString(&lt;RouterContext {...renderProps} createElement={(Component, props) =&gt; {return &lt;Component customP={"boaz"} {...props} /&gt;;}} /&gt;);
  
  return res.render('index', {markup});
  </code></pre>
  
  <p><strong>index.ejs</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
      &lt;title&gt;vetevo dashboard&lt;/title&gt;
      &lt;link rel="stylesheet" href="/css/style.css"&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div id="main"&gt;&lt;%- markup -%&gt;&lt;/div&gt;
      &lt;script src="/js/bundle.js"&gt;&lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>routes.js</strong></p>
  
  <pre><code>const routes = (
    &lt;Route path="/dashboard" component={Layout}&gt;
      &lt;IndexRoute foo="bar" component={DashboardPage}/&gt;
      &lt;Route path="*" component={NotFoundPage}/&gt;
    &lt;/Route&gt;
  );
  </code></pre>
  
  <p>And finally the most important part: <strong>DashboardPage Component</strong></p>
  
  <pre><code>  constructor(props) {
      super(props);
      console.log(props.customP);
    }
  
    render() {
      //console.log(this.props);
      return (
        &lt;div className="dashboard"&gt;
          &lt;h2&gt;This is the component: {this.props.customP}&lt;/h2&gt;
          &lt;h1&gt;SA&lt;/h1&gt;
        &lt;/div&gt;
      );
    }
  </code></pre>
  
  <p>The weird thing is that the customP prop is shown for a millisecond and then disappears. Not only that - I get in the console.log in the constructor function the right value. I think that leads to the conclusion that there is another render happening or the render is crushing.
  I can't find the reason why, but componentDidMount() is also not responding.</p>
  
  <p><strong>Update</strong></p>
  
  <p>console.log works for componentDidMount() but the props and state is undefined there, while in the console.log in constructor they are appearing exactly as they should...</p>
  
  <p>Any help would be appreciated.</p>