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

Cannot use boolean with 'mobile' props in Comments component #148

Closed
c0dester opened this issue Oct 12, 2019 · 5 comments
Closed

Cannot use boolean with 'mobile' props in Comments component #148

c0dester opened this issue Oct 12, 2019 · 5 comments
Labels

Comments

@c0dester
Copy link

I found, that it doesn't matter if I use true or false with mobile prop. Comments will always display as mobile. I need to use undefined instead of false. It is not convenient, since when I use f.e. react-media, I would do:

<Media
  queries={{
    mobile: {
      maxWidth: 768,
    },
    desktop: {
      minWidth: 769,
    },
  }}
>
  {matches => (
    <Comments
      href="HREF"
      mobile={matches.mobile}
    />
  )}
</Media>

Instead of that I have to use it this way:

<Media
  queries={{
    mobile: {
      maxWidth: 768,
    },
    desktop: {
      minWidth: 769,
    },
  }}
>
  {matches => (
    <Comments
      href="HREF"
      mobile={matches.mobile || undefined}
    />
  )}
</Media>
@seeden
Copy link
Owner

seeden commented Nov 11, 2019

Why not matches.mobile || false

@c0dester
Copy link
Author

Because as I wrote, it takes true or undefined. False acts as true

@seeden
Copy link
Owner

seeden commented Nov 25, 2019

Ahh I see. Interesting.

@c0dester
Copy link
Author

Not sure if you understood me correctly. I'm talking about Comments mobile prop - it accepts true or undefined, false acts like true. I'm not talking about react-media.

@seeden
Copy link
Owner

seeden commented Nov 25, 2019

Yeah, I understand it. It looks like a problem in the facebook sdk. Because valid false value is to use this component without mobile property. I will check it and maybe I set correct value with false property as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants