Closed zihuaihuai closed 1 year ago
May I kindly redirect you to the Discussions tab and ask you to repost your question there, ideally with better formatting? It's hard to see if the code you pasted is missing bits, or if GitHub is omitting some of your JSX, when it's not in a code block tag. Thanks!
Description:
I am having an issue accessing an entity that I've defined within a Player function component from my App.jsx file. The Entity Component System (ECS) I am using is integrated with React and here's the code for my Player function component:
`export default function Player(props) { const ECS = props.ECS const entity1 = ECS.world.add({name: "test"})
`
And here's how I am trying to use it in my App.jsx file: `function App() { const world = new World() const ECS = createReactAPI(world)
useEffect(()=>{ console.log(world) }, [world])
return ( <>