You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@ionic/react bug: className overrides classes instead of concats #18137
Current behavior:
For the React Ionic app, adding a className to a component may work on initial load but after any interaction it does not gain the needed classes provided by Ionic.
For example if you use styled-components or simply set a className to a component (say toolbar):
The color will apply on initial render but fail after any sort of change to the app, like navigating to the next screen.
Expected behavior: className should be appended to any needed classes built in to Ionic. This would allow the use of CSS-in-JS which is becoming more and more common. Also with some apps (like the one I'm working on) we need to easily set variables via a network retrieved file that contains colors and other customizations.
Steps to reproduce:
Easiest way to reproduce is to create a css class and attach it to something like the <IonToolbar>:
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Activity
silentHoo commentedon May 2, 2019
@Kikketer You can workaround that issue by using
classinstead ofclassName.This is what the official react docs suggest:
https://reactjs.org/docs/web-components.html#using-web-components-in-react
Here's a similar issue reported: #17962
elylucas commentedon May 8, 2019
Fixed in #18231. Thanks!
ionitron-bot commentedon Jun 7, 2019
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.