Skip to content

Commit

Permalink
fix[scene]: some scene props not working. (#52)
Browse files Browse the repository at this point in the history
* fix: interface error
* fix[scene]: scene props not work
  • Loading branch information
hookex committed Mar 19, 2020
1 parent 5726bf3 commit 389bd8b
Show file tree
Hide file tree
Showing 5 changed files with 262 additions and 253 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ compiled
dist
storybook-static
*.lock
debug/
181 changes: 79 additions & 102 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/CreatedInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export interface CreatedInstance<T> {
state?: any
customProps: CustomProps
// TODO: Consider merging these last 2 into a single class/container.
propsHandlers?: HasPropsHandlers<T, any> // These are mostly generated
propsHandlers?: HasPropsHandlers<T> // These are mostly generated
lifecycleListener?: LifecycleListener<T> // Only custom types currently support LifecycleListeners (ie: AttachesToParent)
deferredCreationProps?: any // deferred props for instance with delayed creation (ie: ShadowGenerator that needs Light).
}
Expand All @@ -99,10 +99,10 @@ export class CreatedInstanceImpl<T> implements CreatedInstance<T> {
public readonly metadata: CreatedInstanceMetadata
public parent: CreatedInstance<any> | null = null // Not the same as parent in BabylonJS, this is for internal reconciler structure. ie: graph walking
public children: CreatedInstance<any>[] = []
public propsHandlers: HasPropsHandlers<T, any>
public propsHandlers: HasPropsHandlers<T>
public customProps: CustomProps

constructor(hostInstance: T, metadata: CreatedInstanceMetadata, fiberObject: HasPropsHandlers<T, any>, customProps: CustomProps) {
constructor(hostInstance: T, metadata: CreatedInstanceMetadata, fiberObject: HasPropsHandlers<T>, customProps: CustomProps) {
this.hostInstance = hostInstance
this.metadata = metadata
this.propsHandlers = fiberObject
Expand Down
2 changes: 1 addition & 1 deletion src/ReactBabylonJSHostConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ const ReactBabylonJSHostConfig: HostConfig<
},
parent: null,
children: [],
propsHandlers: new FiberModel(),
propsHandlers: new FiberModel() as any,
lifecycleListener: new CUSTOM_COMPONENTS.ModelLifecycleListener(scene! /* should always be available */, props),
customProps: {}
}
Expand Down
Loading

0 comments on commit 389bd8b

Please sign in to comment.