# JSON (or GLTF) Loader for Three.js in React

**URL:** <https://discourse.threejs.org/t/json-or-gltf-loader-for-three-js-in-react/3898>\
**Category:** Questions\
**Tags:** react, loaders\
**Created:** [August 26, 2018, 1:24am UTC](https://discourse.threejs.org/t/json-or-gltf-loader-for-three-js-in-react/3898 "2018-08-26T01:24:14Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![khansalik](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/khansalik/32/4759_2.png) [@khansalik](https://discourse.threejs.org/u/khansalik)\
**Post date:** [April 9, 2019, 12:36pm UTC](https://discourse.threejs.org/t/json-or-gltf-loader-for-three-js-in-react/3898/10 "2019-04-09T12:36:29Z")

</div>

I found that this was the problem. I used the gltf-webpack-loader npm package to import the path into my React component and then used that path in my loader. It requires a bit of tinkering with the webpack configuration file.

```
import gltfPath from '../path/to/file.gltf'

```

Then use it like this:

```
this.loader.load(gltfPath,
 (gltf) => {
this.scene.add(gltf.scene);
});
```

---

_[View the full topic](https://discourse.threejs.org/t/json-or-gltf-loader-for-three-js-in-react/3898)._
