Reference Third Party Libraries

Installing packages#

You can install packages directly from npm the same way you would in other JavaScript projects, and import them in your code using the ES6 import syntax:

For example, to install and use clsx, first install the package:

npm install clsx

and then import it in your code:

import clsx from "clsx";
export default function ExampleComponent(props) {
return (
<div
className={clsx("ExampleComponent", {
"ExampleComponent-active": props.active,
})}
>
I am a React component.
</div>
);
}