Some react components pass the className props to the child component.
I haven't seen any need for passing className
as a prop in my projects.
why this className
props is been used ? and when should i adopt this approach?
import styled from 'styled-components'
const ReactComponent = ({ className }) => {
return <div className={className}/>
}
const StyledComponent = styled(ReactComponent)``;