We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm trying to nest another React component within the Hammer component:
import React from "react" import Hammer from "react-hammerjs" class Note extends React.Component { render() { let style = { height: "50px", width: "50px", background: "blue" } return <div className="Note" style={ style } > { this.props.name } </div> } } export default class App extends React.Component { handleTap(...args) { alert("tap") } render() { return <Hammer onTap={ (...args) => this.handleTap(...args) }> <Note /> </Hammer> } }
... and I get this error:
It works fine unless I use another React component inside of <Hammer>.
<Hammer>
The text was updated successfully, but these errors were encountered:
I believe I've found a possible work-around for now.
You will need to add the following method to your nested React component:
addEventListener(type, handler, useCapture) { this.el.addEventListener(type, handler, useCapture); }
and make sure to add the ref to the nested component's root element:
ref={el => this.el = el}
I haven't tested it thoroughly, but it's working for me so far.
Sorry, something went wrong.
@storrdev You can just put a div between Hammer and the React component, see here: mosch/react-avatar-editor#132
No branches or pull requests
I'm trying to nest another React component within the Hammer component:
... and I get this error:
It works fine unless I use another React component inside of
<Hammer>
.The text was updated successfully, but these errors were encountered: