Sunday

react-bootstrap-table does not have style

I use react-bootstrap-table but there is no styling.
import {BootstrapTable, TableHeaderColumn} from 'react-bootstrap-table';
import '../node_modules/react-bootstrap-table/dist/react-bootstrap-table.min.css';

.....

<BootstrapTable data={this.state.sprints} striped hover>
      <TableHeaderColumn isKey dataField='sprintNo'>Sprint no</TableHeaderColumn>
</BootstrapTable>

FIX: 
Firstly run the following npm command:
npm install bootstrap --save

Then add this css import to your .js file:
import '../node_modules/bootstrap/dist/css/bootstrap.min.css';

Monday

Change default port for React App

Default port is 3000 for react app. To change it modify the following part of package.json:
     "start": "react-scripts start"

For windows:
"start": "set PORT=8086 && react-scripts start"

For Linux and MacOS to:
"start": "PORT=8086 react-scripts start"

import error >> using react-icons FaPencil

I try to install react-icons as following command:
             >> npm --loglevel info install --save react-icons

And try to use as follow:
import { FaPencil } from 'react-icons/fa'
import { FaTrash } from 'react-icons/fa'

...
 <button><FaPencil /></button>  
 <button><FaTrash /></button>

But I got following error:
Attempted import error: 'FaPencil' is not exported from 'react-icons/fa'.

FIX:
fa icons are free except for pencil. It needs pro license.
So you can use free version as follow:
import { FaPencilAlt } from 'react-icons/fa'
import { FaTrash } from 'react-icons/fa'

...
 <button><FaPencilAlt /></button>
 <button><FaTrash /></button>

How can I upgrade npm on Windows?

Firstly, Run PowerShell as Administrator. Then run the following commands with order.

Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
npm install -g npm-windows-upgrade
npm-windows-upgrade