-
Notifications
You must be signed in to change notification settings - Fork 188
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
Rheostat initialize creates a conflict with React-dates initialize #179
Comments
@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 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 |
Maybe instead of having the defaults overwrite the theme, it should merge them, allowing the namespaces to prevent collisions? |
@majapw can you provide the file path of the |
In my case :
Thanks for the "Fix" |
Is it possible to use react-with-styles for rheostat but NOT for react-dates? ATM I have theming conflicts because my styles get overwritten... |
Thanks for the great projects! I have a couple related questions, whenever you have a moment @majapw ...
I've been working on figuring out a way to properly merge theme objects in Thanks again 🎉 |
I didn't like this solution, so I came up with the following
This would negate the current requirement to setup 'ThemedStyleSheet' for rheostat. Sadly this currently doesn't work for react-dates owing, I think, to a fairy simple oversight that I have brought up here: react-dates/react-dates#2029 Therefore this only half fixes the problem, but at least your rheostat component can be encapsulated. |
If you install both packages they are unable to work, they seem to overwrite each other since v3.0.0 😞
The text was updated successfully, but these errors were encountered: