hmans/miniplex

[miniplex-react] Doesn't work in Strict mode

itsdouges opened this issue · 6 comments

When running in strict mode you'll get this error: Tried to add components to an entity that is not managed by this world.. It's most likely from effects double rendering.

Broken sandbox: https://codesandbox.io/s/strict-mode-doesnt-work-spxtev?file=/src/index.tsx
Working sandbox: https://codesandbox.io/s/entity-deleted-when-updating-component-cmk0og?file=/src/index.tsx

hmans commented

Hi, and thanks for submitting this issue! I will look into it. I did some testing with Strict Mode that didn't reveal any issues, but maybe I was testing the wrong things.

hmans commented

I think I might have introduced this bug with a last-minute change I made before 1.0.0. :( Working on a fix.

hmans commented

I have a WIP fix in #175. It doesn't make me particularly happy, but it works. The PR also adds a small test app (for strict mode in particular) that is similar to your sandbox. Can you give it a quick glance please?

hmans commented

I'm reopening this because the issue we've discussed in #174 is clearly a Strict Mode issue that needs to be fixed.

hmans commented

Alright, I can't solve this today, I'm about to lose the entire day to this and have other things that need doing first. I will revisit this soon with a clear head. :(

hmans commented

The good news is that this is solved.

The bad news is that this is solved in the upcoming new 2.0. :-)

I'm going to close this ticket, even though it'll be another couple of days before I release a 2.0 final. I've been pushing prerelease builds, though, and will update the documentation this weekend.