1

I am new to ReactJS, I know that in ReactJS we use className instead of class in HTML, but I still tried to use class and found that it was working with some warning!

Warning: Invalid DOM property class. Did you mean className?

The classes that I am using are from Bootstrap.....

code snippet!

If we are still able to use class why are we going for className?

1 Answers1

1

The actual code you write for react is called JSX, you can think of it like a javascript with some modification. So when you write the HTML-like code ,that is actually javascript "modded". I don't know the exact reasong why React Developers changed the syntaxes for that but I think it is so it dosen't blend with HTML code.As you will further see there are some rules you have to follow when working with React ,that compiles even if you don't follow them, finally getting warnings like that you wrote.

MichaelSpx
  • 11
  • 1
  • 1