Comments (4)
Seems like I'm doing things correctly, because if I modify my component from using aphrodite-jss,
import {StyleSheet, css} from 'aphrodite-jss'
import {Component} from 'react'
export default
class Foo extends Component {
render() {
return <div className={css(classes.footer)}>
<div className={css(classes.logoAndCopyright)} />
</div>
}
}
const classes = StyleSheet.create({
footer: {
// ...
'& $logoAndCopyright': {
// ...
},
},
logoAndCopyright: {},
})
to using plain JSS (from react-jss), then it works great:
import {jss} from 'react-jss'
import {Component} from 'react'
export default
class Foo extends Component {
render() {
return <div className={classes.footer}>
<div className={classes.logoAndCopyright} />
</div>
}
}
const {classes} = jss.createStyleSheet({
footer: {
// ...
'& $logoAndCopyright': {
// ...
},
},
logoAndCopyright: {},
}).attach()
So seems something isn't working in aphrodite-jss
.
from aphrodite-jss.
I think the problem is the order of evaluation. The rules are lazily attached, which means the rules are only attached once css
is being called with them. The footer
rule is being attached before the logoAndCopyright
rule, which results in the warning.
I don't know if we can fix this. You can just call css(classes.logoAndCopyright)
before which should fix your problem.
from aphrodite-jss.
Hmmm, that may be a strange caveat. It'd be nice to fix it. Well I've switched to react-jss because I was able to get that to work with SSR in the other thread, and to use aphrodite-jss I would have to solve the same problem again for aphrodite-jss.
from aphrodite-jss.
As I see - it's old issue - but maybe somebody gonna looking for solution as I - to resolve this I moved style Initialization inside of component body
from aphrodite-jss.
Related Issues (15)
- Media queries HOT 1
- out of date packages HOT 1
- Keyframes HOT 3
- Can't edit styles in Chrome HOT 2
- Add more tests HOT 3
- Broken with new versions of JSS? HOT 2
- @keyframes don't work HOT 10
- Action required: Greenkeeper could not be activated 🚨
- Using with React
- Unable to render media queries HOT 4
- merge is one-level HOT 31
- How to Dynamically Theme Components HOT 1
- Alternate name for the project? HOT 28
- Outdated node engine specified in package.json HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aphrodite-jss.