How to style a component without wrapping it inside a div in react js? How to pass a prop and style that component based on the | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to style a component without wrapping it inside a div in react js? How to pass a prop and style that component based on the

const Compo1: React.FC<{}> = () => ( <App1 loading={true} /> ); export const loading = () => ( <Org1 isOpen={true} loading={true}> <LoadingC/> </Org1> ); How can i give this component a paddig of py-1?

12th Feb 2020, 8:59 AM
Ahmad
Ahmad - avatar
1 Answer
+ 1
The probably most common ways to style a component are - import a css file - pass the value to the style property style={padding: '1px'}
24th Feb 2020, 11:56 PM
Tashi N
Tashi N - avatar