Reputation: 3991
How can I apply the ::-webkit-scrollbar
pseudo elements to a component using inline styling in React?
Upvotes: 23
Views: 31103
Reputation: 1651
You can't write pseudo
selector inline, you need to add it in css. Refer this link
Upvotes: 15
Reputation: 2089
React suggests this
<div style={{ '&::WebkitScrollbar': { width: 0, height: 0 } }}></div>
Upvotes: 3