Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReactDOMServer stops rendering on react-dimensions decorated components #56

Open
aeneasr opened this issue Oct 27, 2016 · 0 comments
Open

Comments

@aeneasr
Copy link

aeneasr commented Oct 27, 2016

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:

<div>
  <p> cool text </p>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant