Closed kevinz917 closed 2 years ago
Hi @kevinz917,
I’m afraid I won’t be able to help you with this. The complete React reconciliation + each components behavior has been tested thoroughly. We haven’t faced this issue before. I guess there must be something in your code that’s causing this issue..
I’ve tested react-pixi with different state managers, including mobx, and everything works as expected.
Feel free to dive in and isolate the problem. Once you’ve isolated the problem, please share a Codepen or codesandbox link that proves any issues related to this library.
I’ll close this issue now, please let me know if we need to reopen this
Thanks!
Description
Hey! I'm currently using react-pixi to power my game and I'm running into issues of the renderer mis-rendering blocks. I have a mobx store that stores the tile type on each coordinate and the React component is re-rendering using mobx, but the library is consistently rendering the tile images wrong. However if I refresh the whole webpage again it's rendered correctly. I was wondering if this has happened before, and any best practices to solve this. Thank you!
React component that's being re-rendered.
`const renderBlocks = (map: MasterMap): ReactElement[] => { const allBlocks: ReactElement[] = [];
// add different blocks to render map.forEach((value: TileType, pos: string) => { const { x, y } = decodePosStr(pos); const scaledPos = { x: Number(x) SCALE, y: Number(y) SCALE };
}) return allBlocks; }
const Blocks = observer(() => { return <>{renderBlocks(toJS(gameCore.masterMap))}</>; }) export default Blocks;`
Thank you!