im really confused what is the best way to integrate fontawesome to reactjs web app using CDN or installing NPM for production ecommerce i also use webpack for react
You can use Fontawesome npm package. When you use npm package, just used icons will add to your component. This help page size while loading.
Step 1 ) Add packages with npm:
npm i --save @fortawesome/fontawesome-svg-core
npm install --save @fortawesome/free-solid-svg-icons
npm install --save @fortawesome/react-fontawesome
Or for free regular icons:
npm install --save @fortawesome/free-regular-svg-icons
Step 2 ) Import fontawesome to your component:
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
Step 3 ) Import icon that you need:
import { faCoffee } from '@fortawesome/free-solid-svg-icons'
Step 4 ) Add jsx tag where you want in return function in component:
<FontAwesomeIcon icon={faCoffee} />