Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-primitives Touchable doesn't work #104

Closed
tysoncadenhead opened this issue May 22, 2017 · 7 comments
Closed

react-primitives Touchable doesn't work #104

tysoncadenhead opened this issue May 22, 2017 · 7 comments

Comments

@tysoncadenhead
Copy link

First 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:

screen shot 2017-05-22 at 10 08 57 am

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

@jemgold
Copy link
Contributor

jemgold commented May 23, 2017

Thanks for reporting @tysoncadenhead - looks like we have a fix coming, bear with us 🙏

@jemgold
Copy link
Contributor

jemgold commented Jun 29, 2017

Should be fixed with react-primitives@^0.4.3

@dominicfallows
Copy link

To confirm, it doesn't seem to be fixed in react-primitives@^0.4.3. I'm using CRNA:

"dependencies": { "expo": "^18.0.3", "react": "16.0.0-alpha.12", "react-native": "^0.45.1" }

lelandrichardson/react-primitives#71 (comment) states that "React 16" isn't compatible yet, but CRNA (and react-native init) only function correctly with React 16+

Any ideas on timings to resolve this?

@jemgold
Copy link
Contributor

jemgold commented Jul 8, 2017

cc @lelandrichardson

@jemgold jemgold reopened this Jul 8, 2017
@theTechie
Copy link

Yes. Still not working with 0.4.3. (using CRNA)

"react": "15.4.0",
"react-dom": "15.4.0",
"react-primitives": "^0.4.3",

@mathieudutour
Copy link
Collaborator

Could you try with v0.4.4?

It's definitely defined here: https://github.com/lelandrichardson/react-primitives/blob/master/src/injection/react-sketchapp.js#L12-L24

@tafelito
Copy link

tafelito commented Apr 11, 2018

@mathieudutour is this working on react 16.3? I'm having this same issue using v0.5 and react 16.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants