Jarzka / stylefy

Clojure(Script) library for styling user interface components with ease.
MIT License
317 stars 10 forks source link

Getting Invalid DOM property `class`. Did you mean `className`? #49

Closed pragyanatvade closed 4 years ago

pragyanatvade commented 4 years ago

I am getting

Invalid DOM property `class`. Did you mean `className`?

Warning while using stylefy. Is there a way I can rename this or fix this in my application?

Jarzka commented 4 years ago

This error does not come from stylefy, but it's a React feature. React does not accept class property name, but wants className instead (which it converts back to class in the end). Reagent, however, does not have such limitation.

Are you sure you are using Reagent in your project? If Reagent is set up correctly, you should be able to create HTML elements with class property with or without using stylefy.

pragyanatvade commented 4 years ago

I am trying to use fulcro with stylefy. I am trying to figure out is there any workaround for this issue?

Jarzka commented 4 years ago

I'm not familiar with fulcro, but if I'm right it uses React directly instead of Reagent. stylefy requires Reagent because the asynchronous style generation depends on Reagent atoms. Thus, currently there is no workaround for this.

There has been some discussion in the past of making stylefy Reagent free. Technically this is possible, but not without sacrifing some rendering speed.

pragyanatvade commented 4 years ago

OK. I will try out something else. Thanks a lot for the help. :)

Dissa123 commented 3 years ago

This Problem was to me, I did use Bootstrap, and I forgot to put 'className' After I changed className My Problem was Solved.