Like any other React component, under the hood styled-component is creating a valid React component which you will use in JSX.
If you use my approach to divide the styled and the logic in two different files (with MyComponent.js and MyComponentBase.js) all props go through both JS and you can decide where to use them.
That's correct, they're available on the styled.div because you pass the props when you use the component in the JSX, check the example provided in the official webpage: styled-components.com/
Where do the props come from for the dynamic styled-component for
props => props.primary
?Like any other React component, under the hood styled-component is creating a valid React component which you will use in JSX.
If you use my approach to divide the styled and the logic in two different files (with MyComponent.js and MyComponentBase.js) all props go through both JS and you can decide where to use them.
But you don't have to pass them in to a function manually? They're just automatically available on the styled.div template string as a "props" object?
That's correct, they're available on the styled.div because you pass the props when you use the component in the JSX, check the example provided in the official webpage: styled-components.com/
Thanks, I see now. They're the actual props passed to the styled component. Since the library creates components and not just styles