themeteorchef / base

A starting point for Meteor apps.
http://themeteorchef.com/base
MIT License
688 stars 252 forks source link

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

Open Bandit opened 7 years ago

Bandit commented 7 years ago

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.

themeteorchef commented 7 years ago

Didn't know about this! Flagging this as a refactor. Good find :)