CSS class names no longer working with 20.3.0
See original GitHub issuereact-dates version react-dates@20.3.0
Describe the bug
A project that was working with 20.2.5 using react-dates/initialize
to get old-school class names is no longer working after upgrading to 20.3.0. Appears to be this PR: https://github.com/airbnb/react-dates/pull/1758
Now getting the Cannot read property 'createLTR' of undefined
like you got in the past if you didn’t use initialize.
Maybe this just needs documentation? Not sure what it meant by “css injected prop”
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
CSS class names no longer working with 20.3.0 #1766 - GitHub
A little more investigation on my part has me thinking the issue is likely at least partly our setup. We have react-dates in...
Read more >CSS class starting with number is not getting applied
The reason for this is that "CSS identifiers" may not start with numbers. In CSS, class names used in selectors are considered "CSS...
Read more >Loops in CSS Preprocessors | CSS-Tricks
Preprocessor loops will not cause dramatic explosions in space (I hope) ... by looping through a simple list of colors, to see how...
Read more >Intellisense does not show up for css style class names in ...
I just open visual studio 2022 preview, then open an existing project or create a new one. When I start typing class value...
Read more >nth-of-type() - CSS: Cascading Style Sheets - MDN Web Docs
The :nth-of-type() CSS pseudo-class matches elements based on their ... The second paragraph has a class of fancy but is not matched as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It might be that webpack’s automatic bundle splitting isn’t consistently deduping both react-dates and react-with-styles?
@mstanaland The “css injected prop” refers to the
css
prop thatwithStyles()(Component)
injects into components it wraps fromreact-with-styles
. This is the framework that’s used for styling allreact-dates
components. InternallywithStyles
looks something like this (simplified for brevity):So there’s no need to import
css
directly, especially not from withinreact-dates
components. This ensures that thecss
function used is the one that’s been registered throughThemedStyleSheet.registerInterface()
, which in turn is what should be called byreact-dates/initialize
.Update: ~I’m looking at that function right now and I’m not seeing any calls to
ThemedStyleSheet.registerInterface()
, which explains why you’re getting the errorCannot read property 'createLTR' of undefined
, sincecreateLTR
is accessed from that object that is undefined.~ (I confused the theme with the interface). It’s definitely registering the CSSInterface.What surprises me is that this error wasn’t happening before. Can you share the complete trace for that error?
cc @ljharb