#Ionicons not working with React

3 messages · Page 1 of 1 (latest)

mild moon
#

I had className in my JSX on Ionicon element but it was never read properly by browser so I changed the directive's name to class and it worked . Why is this happening? Supposing that in React we always use className instead of class.

kindred scaffold
#

Hi Swaraj, would you mind sharing a snippet of the code?

mild moon
#

For eg:

export default function Navbar() {
  return (
    <div class="navbar">
      <ion-icon class="navbar__img" name="earth-outline"></ion-icon>
      <h1>My Travel Journal</h1>
    </div>
  );
}