p5.js-web-editor
p5.js-web-editor copied to clipboard
`withLabel` warning re: calling `styled` inside a component
The withLabel HOC calls styled from inside the returned Icon component:
https://github.com/processing/p5.js-web-editor/blob/a4a5742cd5e32c73aca9d42a72af134ef0461512/client/common/icons.jsx#L31-L33
This causes a warning in the console:
The component icons__StyledIcon with the id of "icons__StyledIcon-sc-xmer15-0" has been created dynamically. You may see this warning because you've called styled inside another component. To resolve this only create new StyledComponents outside of any render method and function component.
https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method