static-import

Installation
SKILL.md

Static Import

The import keyword allows us to import code that has been exported by another module. By default, all modules we're statically importing get added to the initial bundle. A module that is imported by using the default ES2015 import syntax, import module from 'module', is statically imported.

Let's look at an example! A simple chat app contains a Chat component, in which we're statically importing and rendering three components: UserProfile, a ChatList, and a ChatInput to type and send messages! Within the ChatInput module, we're statically importing an EmojiPicker component to be able to show the user the emoji picker when the user toggles the emoji.

When to Use

  • Use this for importing modules that are needed immediately on page load
  • This is the default import mechanism — understand it to know when to switch to dynamic imports

Instructions

  • Use static imports for modules critical to the initial render
  • Be aware that all statically imported modules are bundled into the initial bundle
  • Consider switching to dynamic imports for modules not needed on initial render

Details

Related skills
Installs
366
GitHub Stars
202
First Seen
Mar 30, 2026