Final answer:
To pass props to a styled component in React, simply pass the desired prop as a regular HTML attribute using the curly braces notation. Then, access this prop value within the styled component using the props object.
Step-by-step explanation:
To pass props to a styled component in React, you can simply pass the desired prop as a regular HTML attribute using the curly braces notation. Let's assume you have a styled component called Button and you want to pass a prop called color, you can do it as follows:
<Button color={'red'}>Click me</Button>
In the above example, the prop color is being passed with the value 'red' to the Button component. You can then access this prop value within the styled component using the props object. For example:
const Button = styled.button` color: ${props => props.color}; `;
In the above code, the color prop value is being used to determine the CSS color property of the Button component.