I just read in the styled-components documentation that the following is wrong and it will affect render times. If that is the case, how can I refactor the code
styled-components
Consider styled components documentation gives example of using reacts context api [2] for different themes.
[1] https://www.styled-components.com/docs/advanced
[2] https://reactjs.org/docs/context.html