lelandrichardson / react-primitives

Primitive React Interfaces Across Targets
MIT License
3.09k stars 108 forks source link

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

Closed MrLoh closed 6 years ago

MrLoh commented 7 years ago

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.

dominicfallows commented 7 years ago

Perhaps related to:

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

ktj commented 7 years ago

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

kirkbrauer commented 6 years ago

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?

matthewtsinontas commented 6 years ago

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

mathieudutour commented 6 years ago

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