I think I found a bug (Not sure)
When extending
RComponent
and you
override
methods with arguments that are called from
react
directly (i.e.
componentDidUpdate(prevProps,prevState,snapshot)
or
componentWillReceiveProps(nextProps)
), generated
javascript
code always throws a
ClassCastException
.
Lets take a look at
componentWillReceiveProps(next)
. The
IR Compiler
generates
javascript
code similar to this
PaginatedGridComp.prototype.componentWillReceiveProps = function (nextProps) {
return this.componentWillReceiveProps_17(nextProps instanceof Props_19 ? nextProps : THROW_CCE());
};
Since
react
creates
nextProps
internally, the check
nextProps instanceof Props_19
always fails. Hence it throws
CCE
Is there a work around to this problem?
IR Compiler Backend