LoginSignup
0
2

More than 5 years have passed since last update.

React + webpackな環境でthree.jsを使う。

Posted at

Reactで作成したコンポーネント内でthree.js使おうとしたら結構ハマったので、メモ。

1. three.jsをnpmインストールする。作業フォルダに移動して以下を実行。

npm install --save-dev three

2. 使用箇所のJS内に以下一行を記述。

import * as THREE from 'three';

これだけで済む話でした。

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2