From 8993cea5053539dbf9527225a70344f9a2cf0fef Mon Sep 17 00:00:00 2001 From: Dominic Rubas Date: Tue, 12 Jan 2021 22:34:16 +0100 Subject: [PATCH 1/3] ES6 Import --- src/babylonjs-hook.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/babylonjs-hook.tsx b/src/babylonjs-hook.tsx index e675a50..d1fe8fe 100644 --- a/src/babylonjs-hook.tsx +++ b/src/babylonjs-hook.tsx @@ -1,5 +1,10 @@ import React, { useEffect, useContext, useRef, useState } from 'react'; -import { Engine, Scene, Nullable, EngineOptions, SceneOptions, EventState, Observer, Camera } from '@babylonjs/core'; +import { Camera } from '@babylonjs/core/Cameras/camera' +import { Engine } from '@babylonjs/core/Engines/engine' +import { EngineOptions } from '@babylonjs/core/Engines/thinEngine' +import { EventState, Observer } from '@babylonjs/core/Misc/observable' +import { Scene, SceneOptions } from '@babylonjs/core/scene' +import { Nullable } from '@babylonjs/core/types' import { SceneContext, SceneContextType } from './scene'; import { EngineCanvasContext, EngineCanvasContextType } from './engine'; @@ -201,4 +206,4 @@ export default (props: BabylonjsProps) => { ); -} \ No newline at end of file +} From 2e63df74301e8fd366c3a5bd3e108f060b7dd49a Mon Sep 17 00:00:00 2001 From: Dominic Rubas Date: Tue, 12 Jan 2021 22:34:49 +0100 Subject: [PATCH 2/3] ES6 Import --- src/engine.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/engine.tsx b/src/engine.tsx index 4299744..1cc6b6e 100644 --- a/src/engine.tsx +++ b/src/engine.tsx @@ -1,5 +1,6 @@ -import { Engine, Nullable } from '@babylonjs/core'; -import React, { createContext, useContext } from'react'; +import React, { createContext, useContext } from 'react' +import { Engine } from '@babylonjs/core/Engines/engine' +import { Nullable } from '@babylonjs/core/types' export type EngineCanvasContextType = { engine: Nullable From aab21a8253f0c3005d5954da0d8d0433b61ad1be Mon Sep 17 00:00:00 2001 From: Dominic Rubas Date: Tue, 12 Jan 2021 22:35:29 +0100 Subject: [PATCH 3/3] ES6 Import --- src/scene.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/scene.tsx b/src/scene.tsx index a053460..5605f59 100644 --- a/src/scene.tsx +++ b/src/scene.tsx @@ -1,5 +1,6 @@ -import { Nullable, Scene } from '@babylonjs/core'; -import { createContext, useContext } from 'react'; +import { createContext, useContext } from 'react' +import { Scene } from '@babylonjs/core/scene' +import { Nullable } from '@babylonjs/core/types' export type SceneContextType = { scene: Nullable @@ -14,4 +15,4 @@ export const SceneContext = createContext({ /** * Get the scene from the context. */ -export const useScene = (): Nullable => useContext(SceneContext).scene; \ No newline at end of file +export const useScene = (): Nullable => useContext(SceneContext).scene;