lelandrichardson / react-primitives

Primitive React Interfaces Across Targets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: Cannot read property 'injection' of undefined

TNorth22 opened this issue · comments

New to React. Successfully running project but as soon as I import anything from react-primitives I get an error import { View, Image} from 'react-primitives'; i.e.
screen shot 2018-10-30 at 5 59 32 pm

I saw a few closed PR's around react v16 not being supported but them seemed to indicate it now it is? Thoughts?

Config:

{
  "name": "react-primitive-web-spike",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.6.0",
    "react-dom": "^16.6.0",
    "react-primitives": "^0.6.1",
    "react-scripts": "2.1.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ]
}

Hey TNorth22, It's because the repo hasn't been updated with the most recent react. I think theres a few of us wanting to use primitives as its a dependancy for styled-components/primitives but being held up by this error. Heres a fix that was mentioned in another post
#120

change your react primitives module in your package.json to
"react-primitives": "tkow/react-primitives#0.7.0"
It's a temp fix but hope this helps.