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

Supported API for making new event types (i.e., event plugin injection) #1729

Closed
tmcw opened this issue Jun 21, 2014 · 2 comments
Closed

Supported API for making new event types (i.e., event plugin injection) #1729

tmcw opened this issue Jun 21, 2014 · 2 comments

Comments

@tmcw
Copy link
Contributor

tmcw commented Jun 21, 2014

I'm trying to implement a scrollable list of items that are tappable on mobile devices. It looks like there are two plugins that address the 'how to tap' problem - https://github.com/facebook/react/blob/master/src/browser/eventPlugins/MobileSafariClickEventPlugin.js & https://github.com/facebook/react/blob/master/src/browser/eventPlugins/TapEventPlugin.js .

I'm confused about Plugins: they aren't mentioned in the docs, and it's unclear if they're things that you can build in runtime, with require('react') or which require recompilation with Grunt. Is the plugin system itself in flux? I'd love to help out on getting these merged so that developing mobile apps is more straightforward.

@sophiebits sophiebits changed the title Using plugins? Using event plugins? Jun 22, 2014
@syranide
Copy link
Contributor

http://facebook.github.io/react/docs/top-level-api.html#react.initializetouchevents and #436

For now you need to manually build a version of React with TapEventPlugin and also call initializeTouchEvents.

PS. EventPlugins are not really plugins in the general sense of them being externally pluggable, but rather that they're internally indepedent features.

@sophiebits sophiebits changed the title Using event plugins? Supported API for making new event types (i.e., event plugin injection) Jun 24, 2014
@jareware
Copy link

Yes! This is exactly what I'd want. That is, being able to tell React to start managing new named DOM events, e.g.:

// NOTE: Fictive API:
React.registerDomEvent({
  eventName: 'foo-bar',
  eventProp: 'onFooBar'
});

Having an API like this would make it much, much simpler to hook in things like external gesture recognizers etc.

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

3 participants