MCPcopy
hub / github.com/pixijs/pixi-react / prepareInstance

Function prepareInstance

src/helpers/prepareInstance.ts:9–24  ·  view source on GitHub ↗
(
    component: T,
    state: Partial<InstanceState> = {},
)

Source from the content-addressed store, hash-verified

7
8/** Create the instance with the provided sate and attach the component to it. */
9export function prepareInstance<T extends Container | Filter | HostConfig['instance']>(
10 component: T,
11 state: Partial<InstanceState> = {},
12)
13{
14 const instance = component as HostConfig['instance'];
15
16 instance.__pixireact = Object.assign({
17 filters: [],
18 parent: null,
19 root: null as unknown as HostConfig['containerInstance'],
20 type: '',
21 }, state);
22
23 return instance;
24}

Callers 4

applyProps.test.tsFile · 0.90
createRootFunction · 0.90
createInstanceFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected