Skip to content

Error when Touchable is bundled #99

@likethemammal

Description

@likethemammal

On web, Touchable errors when react-primitives is bundled with a react component thats then bundled, for instance, as an npm package.

Warning: Unknown event handler property `onStartShouldSetResponder`

Took me a while to prove to myself that it was an issue with react-primitives. I've written a stripped down example repo that reproduces the issue. Heres a direct link to the hypothetical component that would use react-primitives, its a really simple implementation

Repo with bug reproduced

Screenshot:

screenshot of bug

I originally thought this had something to do with react-primitives not being up to date with React 16, and react-dom getting angry about it. Spent a lot of time debugging devDependencies and peerDependencies. Also tweaked and trimmed down my webpack config to try to figure out any bundling issue. I've recreated the issue in that repo using react-primitives at react@16.2.0 and react@15.4.2. It happens in either version. (I used my PR upgrading react-primitives to React 16 for the example at 16.2.0)

The example repo has a small webpack config for the hypothetical component and a separate webpack config for the example dir showcasing the component's usage. All I've done in the hypothetical component is import Touchable and added a simple View and Text for something to click on. On refresh I get the error output above

Does anyone have any idea what the issue is? Is webpack doing something I'm not seeing?

This is preventing me from using react-primitives in several open source components I'd like to write

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions