Is it possible to set a className on custom react components?

Posted by Pinki | Updated on

Is it possible to set a className on custom react components? You can, but you should propagate the prop to the inner component. If not, it doesn’t know about it.

To make the CSS query you want to accomplish, then you should create the div inside your component.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers