question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rheostat initialize creates a conflict with React-dates initialize

See original GitHub issue

If you install both packages they are unable to work, they seem to overwrite each other since v3.0.0 😞

...
"react-dates": "^16.7.0",
"rheostat": "^3.0.0",
...

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:6
  • Comments:7

github_iconTop GitHub Comments

12reactions
majapwcommented, Jul 9, 2018

@castrolem Ahhh thank you for bringing this to our attention. :X This is the usage we should have thought about (since it is our own) and added to the README when we release this major version. If you want to get both working, right now, the easiest way to do so is to do the following instead of importing the initialize script:

import 'rheostat/css/rheostat.css';
import 'react-dates/lib/css/_datepicker.css';

import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet';
import cssInterface from 'react-with-styles-interface-css';
import RheostatDefaultTheme from 'rheostat/lib/themes/DefaultTheme';
import ReactDatesDefaultTheme from 'react-dates/lib/theme/DefaultTheme';

ThemedStyleSheet.registerInterface(cssInterface);
ThemedStyleSheet.registerTheme({ 
  ...RheostatDefaultTheme,
  ...ReactDatesDefaultTheme,
});

I’ll add this to the README (here and in react-dates) as well as the motivation behind moving to react-with-styles and dealing with these global themes and interfaces while we mull over how we can improve this process.

@ljharb @lencioni for thoughts on this as well.

4reactions
ljharbcommented, Jul 9, 2018

Maybe instead of having the defaults overwrite the theme, it should merge them, allowing the namespaces to prevent collisions?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add a Date Picker with Airbnb's React Dates Package
We can add a date picker easily with Airbnb's React Dates packages. ... We import the react-dates/initialize package to run the initialization code....
Read more >
Bountysource
Rheostat initialize creates a conflict with React-dates initialize.
Read more >
react-dates broken - not recognising css? - Stack Overflow
Ok i found an answer for this problem, so: Are you trying to render the calendar inside another element that is not always...
Read more >
Storybook - GitHub Pages
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Read more >
React custom datepicker: Step-by-step - LogRocket Blog
The date input type presents a datepicker to the user, however, the appearance of this datepicker is inconsistent across browsers.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found