airbnb / airbnb/react-with-styles
Exporting multiple objects while using withStyles
- Dominant language
- JavaScript
- Stars
- 1.7k
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
Is it necessary that the component to which `withStyles` has been applied be exported as default?
If not, how can I export multiple components after applying `withStyles` on each of them?
i.e. I'm trying to do something like -
```jsx
class comp1 extends React.Component{....}
withStyles(styles1)(comp1)
class comp2 extends React.Component{....}
withStyles(styles2)(comp2)
module.exports = {
comp1 : comp1,
comp2: comp2
};
```
But ,it's not working..
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue names only the withStyles usage and a two-component export example; it provides no repository file, test, or exact failure. Start by reproducing that example and tracing the withStyles entry point, then verify that both exported components can be imported and rendered with their styles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100