airbnb / airbnb/react-with-styles
Question about syntax
- Dominant language
- JavaScript
- Stars
- 1.7k
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
Hi, Yesterday I took your package to replace withStyles from material-ui for yours.
I have a question about construction
`
As for me that syntax is slightly redundant and also with that I can't use "classname" package, as example:
`{ classnames(css(styles.classname1)), {classnames(css(styles.classname2)): this.state.error } }`, or simply add some static styles, as example:
`
`
That's work with JSS and Aphrodite.
Methods that I wrap:
```
const cssWrapper = (...params) => css.apply(css, params).className;
const aphroditeInterfaceCustom = {
...aphroditeInterface,
create (styleHash) {
const styles = aphroditeInterface.create(styleHash);
return each(styles, (value, key) => {
styles[key] = cssWrapper(value);
});
}
};
```
So, maybe I don't know or missed something, please explain for me why you chose this approach.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the package's css API and the Aphrodite interface referenced in the report, then compare their className output with the classnames examples. The payload names no files or tests; done would be a clear explanation of the chosen syntax and, if appropriate, documentation of supported composition patterns.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100