pmndrs / drei

🥉 useful helpers for react-three-fiber
https://drei.pmnd.rs/
MIT License
7.83k stars 642 forks source link

Importing from different files creates multiple stores. #1979

Open mayank1513 opened 4 weeks ago

mayank1513 commented 4 weeks ago

Problem description:

I want to import { Loader } from "@react-three/drei/web/Loader" for better treeshaking. But this creates an isolated store.

Similarly, I want to import { KeyboardControls } from "@react-three/drei/web/KeyboardControls". This also creates an isolated store.

For more details, please see https://treeshakable.vercel.app/

Relevant code:

let your = (code, tell) => `the ${story}`

Suggested solution:

I will create a fix using treeshakable.

mayank1513 commented 4 weeks ago

https://github.com/pmndrs/drei/pull/1981

WIP - working on KeyboardControls

Completed - useProgress and Loader