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

Don't work with Flexbox #42

Closed
julioxavierr opened this issue Aug 31, 2018 · 3 comments
Closed

Don't work with Flexbox #42

julioxavierr opened this issue Aug 31, 2018 · 3 comments

Comments

@julioxavierr
Copy link

No description provided.

@gregnb
Copy link
Collaborator

gregnb commented Aug 31, 2018

Please share a sandbox or working example to replicate the issue

@julioxavierr
Copy link
Author

julioxavierr commented Sep 8, 2018

Hi, @gregnb! Thanks for the response and sorry for the late reply.

I am using styled components plus react-to-print. Haven't tested without styled yet, but will give it a try.

Here follows the render example, with comments:

<ContentWrapper ref={el => (this.componentRef = el)}>
  <ReactToPrint
    trigger={() => <Icon href="#">print</Icon>} // Icon from material-ui
    content={() => this.componentRef}
  />
  <SectionTitle>Candidate</SectionTitle>
  <Row> // Here's where the problem really happens, flexbox isn't recognized at all
    <Paragraph>
      <FieldText>Name:</FieldText> {name}
    </Paragraph>
    <Paragraph>
      <FieldText>Date:</FieldText>{' '}
      {new Date()}
    </Paragraph>
  </Row>
  <Row> // Here too
    <Paragraph>
      <FieldText>E-mail:</FieldText> {email}
    </Paragraph>
    <Paragraph>
      <FieldText>Phone:</FieldText> {phone}
    </Paragraph>
  </Row>
</ContentWrapper>

In this example, I have styled div called Row that should render childrens side by side. It works on my layout correctly, but not on react-to-print, he just ignores Flexbox whenever I try to use it.
This gives you some insight of what's happening?

@julioxavierr
Copy link
Author

Made a simpler example on CodeSandbox and it appear to work correctly. Will close this for now.

https://codesandbox.io/s/rrq34wq6lp

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

2 participants