wix-incubator/remx

Introduce strict mode for accessing state

Opened this issue · 0 comments

#66 introduces errors on accessing state in untracked react components in v4.
It's makes switching to v4 difficult for large teams because of the errors amount.
Make it configurable (turned off by default for now) to allow gradually fixing those errors.
Something like:

import * as remx from 'remx';

// remx shouldn't trigger error 
// “[REMX] attemted to access prop 'xxx' in react component untracked by remx”
// until this line:
remx.enableAccessStateStrictMode(true);

// We should be able to turn it off as well:
remx.enableAccessStateStrictMode(false);