0

I am trying to use primeicons in my react app and icons are getting loaded successfully on local environment, however while deployment on server, where there is no internet, icons are not getting loaded.

import '../../node_modules/primeicons/primeicons.css'
    
<button title="Repurchase"
                style={{ borderRadius: '50%', fontSize: '0.8rem', backgroundColor: '#293189', color: 'white' }}
                onClick={() => this.purchase(rowData)}>
                <i style={{ marginTop: '5px' }} class="pi pi-download"></i>
              </button>

Please refer attached image. Can you please helpenter image description here

NKapoor
  • 63
  • 7

1 Answers1

1

Don't import from ../../node_modules/primeicons/primeicons.css your import should just be...

import 'primeicons/primeicons.css';
Melloware
  • 10,435
  • 2
  • 32
  • 62
  • Sorry it also didn't work. :( – NKapoor Jan 31 '22 at 11:10
  • Hmmm yah the internet should have nothing to do with your issue its compiled locally. Are you sure you don't have some other issue? Can you look in Chrome F12 Network tab and see if something is being blocked when you have no internet? – Melloware Jan 31 '22 at 21:18