streamich / nano-css

Distilled CSS-in-JS for gourmet developers
The Unlicense
427 stars 23 forks source link

Why useStyles is not a hook? #230

Closed dy closed 4 years ago

dy commented 5 years ago

According to react convention, components starting with use- prefix are hooks. That's a bit confusing that this component is called like hook but indeed it is not.

Would be nice to just

props => {
let classes = useStyles({
root: {...},
secondary: {...}
})

return <div className={classes.root}></div>
}
streamich commented 5 years ago

useStyles is not a hook because it was created before React released Hooks.

streamich commented 4 years ago

There is useCss hook though, which does Virtual CSSOM.