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

setup innerRef prop #81

Closed
hartzis opened this issue Jul 19, 2017 · 8 comments · Fixed by #82
Closed

setup innerRef prop #81

hartzis opened this issue Jul 19, 2017 · 8 comments · Fixed by #82
Assignees

Comments

@hartzis
Copy link
Collaborator

hartzis commented Jul 19, 2017

use a prop called innerRef like style-components and formsy-react do:

<Swipeable innerRef={(el) => this.swipeableElement = el} >

related to issue #77

solved when PR #82 gets merged and released

@DrBoria
Copy link

DrBoria commented Jul 25, 2017

Error: Unknown prop innerRef on div tag.
Returns after innerRef assignment to swipeable.
I tried using your example and plain string assignment - no success.

@hartzis
Copy link
Collaborator Author

hartzis commented Jul 25, 2017

this is currently still open and the PR #82 hasn't been merged and released.

were you trying with that PR branch?

I should have PR #82 merged in and released to npm this week! 😄

@kelly-tock
Copy link

what would you think about migrating to forwardRef instead? it's a little easier to use.

@hartzis
Copy link
Collaborator Author

hartzis commented Sep 25, 2019

@kelly-tock hey. This issue has been closed a while. Is there an issue you're running into specifically?

As an aside, I'm thinking about dropping the component, <Swipeable>, for the next major release and just providing a hook.

@kelly-tock
Copy link

No issue specifically, I have it working It’s just the now preferred way for refs like inner ref. Please don’t drop the component I think it’s great to provide both.

@hartzis
Copy link
Collaborator Author

hartzis commented Sep 27, 2019

I genuinely appreciate the feedback. It is annoyingly hard to get any positive and constructive feedback in the open source world usually.

I think we could probably keep the component but just do a lighter version maybe that just uses the hook internally.

something simple like this:

export const Swipeable = ({ children, ...props) => {
  const handlers = useSwipeable(props);
  return <div {...handlers}>{children}</div>
}

@hartzis
Copy link
Collaborator Author

hartzis commented Sep 27, 2019

^ i immediately think that this could just be referenced as a straightforward example though and does not need to be bundled with the package...? 🤔

@kelly-tock
Copy link

I would just bundle it for convenience. I think the community will be split for a while but appreciate you wanting to move towards hooks!

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

Successfully merging a pull request may close this issue.

3 participants