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 hooks support? #35

Open
cesarquiroz opened this issue Jan 22, 2020 · 4 comments
Open

react hooks support? #35

cesarquiroz opened this issue Jan 22, 2020 · 4 comments

Comments

@cesarquiroz
Copy link

is there any plan to support functional programming and React hooks for this component? I really want to use it, and we made it work with us implementing React hooks, but now we are getting a warning in the console:

image

and is happening because of this section of code:

image

Plus this causes another warning:

image

because the template item is not being rendered with a unique key.

Thanks

@Macil
Copy link
Collaborator

Macil commented Jan 22, 2020

Currently the template component must be a class-based React component. In the future, I plan on making it so DraggableList follows a render-props pattern instead of taking in a component as a prop, which will avoid this issue of requiring a class-based React component, and will solve some issues inherent to taking a component as a prop.

@cesarquiroz
Copy link
Author

ok thanks!! :)

@DanielChen93
Copy link

Hi @Macil , can current version support functional component as the template component?

@wegry
Copy link
Contributor

wegry commented Dec 7, 2023

can current version support functional component as the template component?

@DanielChen93 as of [email protected], the answer seems to be no.

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.

4 participants