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

Uncaught TypeError: noflip expects a string or a number #2210

Open
aroundus opened this issue Jul 12, 2022 · 1 comment
Open

Uncaught TypeError: noflip expects a string or a number #2210

aroundus opened this issue Jul 12, 2022 · 1 comment

Comments

@aroundus
Copy link

react-dates version
react-dates@21.8.0

Describe the bug
spacing.dayPickerHorizontalPadding is undefined.

Source code (including props configuration)
Steps to reproduce the behavior:

export default withStyles(({
  reactDates: {
    color,
    font,
    noScrollBarOnVerticalScrollable,
    spacing,
    zIndex,
  },
}) => ({
  ...

  DayPicker_weekHeaders__horizontal: {
    marginLeft: noflip(spacing.dayPickerHorizontalPadding), // undefined
  },

  ...
}), { pureComponent: typeof React.PureComponent !== 'undefined' })(DayPicker);

Screenshots/Gifs
스크린샷 2022-07-13 02 48 07
스크린샷 2022-07-13 02 49 52

Additional context
It works normally in production environment. Problem exists only in development environment.

@ljharb
Copy link
Member

ljharb commented Jul 12, 2022

It shouldn't be working in either one. You can't call noflip with undefined.

Try spacing.dayPickerHorizontalPadding != null && noflip(spacing.dayPickerHorizontalPadding)

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