Skip to content
Advertisement

CoreUI Icon doesn’t appear in my react js app

i just started learning react js and using coreui free templates. But i don’t know why the coreui icons not showing. Please correct me if my code is wrong.

This is my step to build first my react js app.

  1. I’ve already install all node module like @coreui/coreui, @coreui/icons-react, and sass-loader
  2. Import style (@import “~@coreui/coreui/scss/coreui”;) in App.js and call login
  3. And this is my code Login (Copy from master.zip from Free CoreUI template)

JavaScript
JavaScript
  1. The result like this. Result

I tried to change the code from master zip <CIcon name="cil-user" /> to <CIcon name={'cil-user'} /> from CoreUI Doc CoreUI Doc but the icon still doesnt appear. Did i miss something?

Advertisement

Answer

Use the following:

JavaScript

Then use it:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement