lelandrichardson / react-primitives

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

this.touchableGetInitialState is not a function #104

Closed abharvey closed 6 years ago

abharvey commented 6 years ago

I've been trying to get react-primitives and styled components going on a project so have been doing some research this week without luck on running it on Native. I've decided to import it from a fresh basic react-native initialized project and am getting this error on Touchable.

All I've done from the basic init is add <Touchable><Text>This is inside a touchable</Text><Touchable> to the App.js file.

Upon inspection of the lib directory, it looks like the issue might be related to the React.createClass function not bringing in the mixins properly. The function itself is in the TouchableMixin file and looks to be properly added to the createClass function. I wonder if the newer React 16 requirements have caused this.

I'd be happy to help refactor these classes up to React 16 if we can prove this is the issue.

Thanks for the insight.

tafelito commented 6 years ago

Same issue here. React 16 should be supported as #98 was merged a while ago. I'm using react 16.3 but I tried with react 16.0 and it doesn't work either

k4h4shi commented 6 years ago

Same issue here.

Versions:

"react": "^16.3.2",
"react-native": "0.55.3",
"react-primitives": "^0.5.0",
"styled-components": "^3.2.6"
k4h4shi commented 6 years ago

@mathieudutour @lelandrichardson This issue was seems fixed by #100. The pull request was already merged to the master branch, but not released yet. Are there any plans for a release? I think the sooner the better because this looks an critical issue. Please and Thank you.

mathieudutour commented 6 years ago

just published 0.5.1 with the fix