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 the classnames, first install the package:
npm install classnames
and then import it in your code:
import classNames from "classnames";
export default function ExampleComponent(props) {
return (
<div
className={classNames("ExampleComponent", {
"ExampleComponent-active": props.active,
})}
>
I am a React component.
</div>
);
}