react-primitives Touchable doesn't work
See original GitHub issueFirst of all, thanks for this awesome project! I’m investigating how this could work at our company to get more client-facing component building in the design team realm and it seems really viable so far!
Now, I may be wrong about the expected behavior, but I thought that all of the react-primitives would work for react-sketchapp. I wouldn’t expect Touchable to do anything in sketch, but I was hoping that it would transparently render so I could share components with interactions with the web and native.
When I attempt something like this:
import React from 'react';
import { Text, View, Touchable } from 'react-primitives';
const Button = (props) => (
<Touchable onPress={() => console.log('hi')}>
<View>
<Text>{props.children}</Text>
</View>
</Touchable>
);
export default Button;
I am getting an error that says:
TypeError: this.touchableGetInitialState is not a function. See the screenshot below:
It works fine when I render it on the web, so it stands to reason this is not an issue with react-primitives. Let me know if I am expecting something that shouldn’t work at all, but it seems logical to me that Touchable should at least render and not be interactive in Sketch.
I am using Sketch 43.2 and react-sketchapp 0.10.0
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Yes. Still not working with 0.4.3. (using CRNA)
@mathieudutour is this working on react 16.3? I’m having this same issue using v0.5 and react 16.3