return ( <> <style> .ant-select-selector {'{'} background: red !important; {'}'} </style> <SomeComponent /> </>
antdなど使っているとSelectコンポーネントの親に対して、styleを定義したい時がある。
cssファイル書きたくない、compoentnt作りたくない、ちょこっとcssだけ書けばいいを目指したら、こんな事になった。
着想参考: The <style> tag and React. I hate adding libraries to my React… | by michael chan | learnreact