I want to know how React inline styling works.
Can I override the inline styles from its parent via props?
// child.js
const Para = ({ styles }) => {
return (
<p style={{ color: 'black', ...styles }}> // Is this best practice?
This is paragraph
</p>
);
I've passed the overriding styles from parent via props.
<Para styles={{ color: 'green' }} />
Yes. What you have done is correct way to do overrides.
Whether you should do this or not, depends on your application needs.