Skip to content

Importing GPUPicker as a module? #3

@mikemklee

Description

@mikemklee

Hi, first of all, thank you for creating this module. Your demo looks amazing.

I wanted to use this in my own application, but I am having difficulty including the module.

I am using React to build my application, so I am using the ES6 import/export syntax to include my modules. However, when I try to do something like

import './GPUPicker.js,

I get an error saying that

'GPUPicker' is not exported from 'three' (imported as 'THREE')

I am not sure how familiar you are with React, but I think what is happening is that the THREE instance that my React component is referring to, and the one that GPUPicker is referring to are not the same.

Including the module in a plain-old <script> tag would of course work because the GPUPicker module would be in the same scope as the rest of the code.

However, I am having trouble here because my application is divided into multiple parts.
Is there a way I can import the module using the ES6 syntax?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions