Skip to content

Import components from react-bootstrap/lib rather than react-bootstrap for performance #233

@Bandit

Description

@Bandit

I'm fairly new to React and npm imports so not sure, but I was reading the react-bootstrap documentation, and saw this:

If you install React-Bootstrap using npm, you can import individual components from react-bootstrap/lib rather than the entire library. Doing so pulls in only the specific components that you use, which can significantly reduce the size of your client bundle.

Changing to import Navbar from 'react-bootstrap/lib/Navbar'; for example seems to still work. Haven't tested the filesize difference yet though.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions