Open aeneasr opened 8 years ago
I want to render a react app to a string and am using the ReadDOMServer to do so:
ReactDOMServer.renderToStaticMarkup(<EditorComponent store={this.props.store} id={this.props.id}` />)
However, I have a component that is wrapped by dimensions:
class Editable extends Component { // ... } export default dimensions()(Editable)
With the dimensions decorator in there, the ReactDOMServer stops rendering all children there. Markup looks something like this:
<div> <div style="width:100%;height:100%;padding:0;border:0;"></div> </div>
while it should look something like this:
<div> <div style="width:100%;height:100%;padding:0;border:0;"> <p> cool text </p> </div> </div>
Removing the dimensions() decorator yields the desired result but breaks other logic that depends on dimensions:
dimensions()
<div> <p> cool text </p> </div>
I want to render a react app to a string and am using the ReadDOMServer to do so:
However, I have a component that is wrapped by dimensions:
With the dimensions decorator in there, the ReactDOMServer stops rendering all children there. Markup looks something like this:
while it should look something like this:
Removing the
dimensions()
decorator yields the desired result but breaks other logic that depends on dimensions: