react-rethinkdb icon indicating copy to clipboard operation
react-rethinkdb copied to clipboard

Fix crash if a component does not mixin Base

Open khoerling opened this issue 9 years ago • 5 comments

  • facilitate 3rd-party mixins

khoerling avatar May 10 '16 06:05 khoerling

This seems safe to merge, but I'm curious what the scenario is in which updateComponent gets called when a component doesn't use the mixin.

mikemintz avatar May 10 '16 06:05 mikemintz

Good question-- it happens in util.js if QueryState is used (for subscriptions).

khoerling avatar May 11 '16 19:05 khoerling

I mean, if a component isn't using the react-rethinkdb mixin, why would updateComponent be called?

mikemintz avatar May 11 '16 20:05 mikemintz

Here's the line that invokes updateComponent in this case: https://github.com/mikemintz/react-rethinkdb/blob/master/src/QueryState.js#L107

khoerling avatar May 11 '16 21:05 khoerling

That makes sense. But I'm also curious exactly what a React developer would have to do in order to reproduce this crash, since to me it seems like updateComponent wouldn't be called on components that don't use the mixin.

mikemintz avatar May 13 '16 05:05 mikemintz