Hoist non react statics
See original GitHub issueWhat will it allow you to do that you can’t do today?
Solve https://github.com/mui-org/material-ui/issues/9736 out of the box. We add a muiName
static property to some of the Material-UI components. However, this static property is lost after wrapping the component with styled-components.
How will it make current work-arounds straightforward?
You are already solving the problem for withTheme: https://github.com/styled-components/styled-components/blob/1dfc7a64ff8ff3706424d68bbe021b8f973ff9db/src/hoc/withTheme.js#L6
What potential bugs and edge cases does it help to avoid?
It’s making the styled component higher-order component transparent to static properties.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:10 (5 by maintainers)
Top Results From Across the Web
hoist-non-react-statics - npm
Copies non-react specific statics from a child component to a parent component. Latest version: 3.3.2, last published: 3 years ago.
Read more >mridgway/hoist-non-react-statics - GitHub
Copies non-react specific statics from a child component to a parent component. Similar to Object.assign , but with React static keywords prevented from...
Read more >hoist-non-react-statics examples - CodeSandbox
Learn how to use hoist-non-react-statics by viewing and forking example apps that make use of hoist-non-react-statics on CodeSandbox.
Read more >Why is VS Code importing from "hoist-non-react-statics ...
VS code intellisense is suggesting that I import from hoist-non-react-statics/node_modules/@types/react instead of from react when importing ...
Read more >hoist-non-react-statics | Yarn - Package Manager
Copies non-react specific statics from a child component to a parent component. Similar to Object.assign , but with React static keywords blacklisted from...
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 Free
Top 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
Sorry … I didn’t notice that. Super! 👍 @probablyup
Hmm I thought we were already doing this. It’s considered a best practice for anything wrapping another component, so I think we should do it.