lelandrichardson / react-primitives

Primitive React Interfaces Across Targets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Warning: ReactClass: You're attempting to include a mixin that is either null or not an object.

MrLoh opened this issue · comments

I am using react-primitives with the latest version of create-react-native-app and am getting this warning. Seems to be a common problem with other packages as well. Or am I doing something wrong?

Warning: ReactClass: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got undefined.

Perhaps related to:

In summary, react-primitives not being yet compatible with React v16+

Not working with react 15.4.x & react-native 0.42.x either.
In native TouchableMixin is not injected.

Has any work been done on this? I am using react-primitives with React v16 and everything is working fine, but this warning is still being thrown. Is v4.4 not yet compatible with React 16?

I did some digging on this issue as I am also encountering the console warning (not stopping build but annoying to clutter the console output).

The issue stems from a missing 'TouchableMixin' argument being passed into src/modules/Touchable.js from the src/injection/react-native.js API injection wrapper.

The fix for this bug has actually been committed into the codebase but has not been tagged into a release yet. Simply point your 'react-natives' package at this commit and that should remove the warning. Here is the snippet of my package.json:

{
  "dependencies" : {
    "react-primitives": "github:lelandrichardson/react-primitives#a248b6a334f48a9dfc36a8703e1056d0c79c9d3d",
  }
}

You have to manually build the files though so not ideal 😕

@mathieudutour or @lelandrichardson Any chance of tagging a new release? It looks like that fix is the only thing that's been committed recently so shouldnt contain any other breaking changes. Happy to help if anything else is needed

the new version has been released a while ago, forgot to close this