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

Update the TaskList Component #15

Merged
merged 3 commits into from
Oct 6, 2020
Merged

Update the TaskList Component #15

merged 3 commits into from
Oct 6, 2020

Conversation

ayush-git228
Copy link
Contributor

I have updated the TaskList Component into functional one. I tried to convert App.js into a functional component as well but it didn't work . Also if there is an error in the TaskList Component please let me know and if you could help with that it would be great.

@jmsv
Copy link
Owner

jmsv commented Oct 6, 2020

I've pulled the tasks list up a component level to App.js which is now being passed down to TasksList, I think this makes more sense than the ref approach I originally used for the class components. Also means there's no need for useImperativeHandle and forwardRef which made things a bit confusing. My bad for the weird structure 🥴

Thanks for the work on this @ayush-git228! ✨

@jmsv jmsv merged commit 8bbabfb into jmsv:master Oct 6, 2020
@jmsv
Copy link
Owner

jmsv commented Oct 6, 2020

This is also merged into all extension branches now 🎉

@ayush-git228
Copy link
Contributor Author

I've pulled the tasks list up a component level to App.js which is now being passed down to TasksList, I think this makes more sense than the ref approach I originally used for the class components. Also means there's no need for useImperativeHandle and forwardRef which made things a bit confusing. My bad for the weird structure 🥴

Thanks for the work on this @ayush-git228! ✨

Sorry for the late reply as I see your comment just right now. Okay so the idea behind using forward ref and useRef was that initailly I was trying to convert the App.js and TaskList comp. both into Func. Comp with react hooks. and so the traditional refs don't work here, the forward ref is to pass the function of child comp. to use in parent comp. and this ref comes useWitha imperative Handler. But it didn't work that well, will more on that in the future but thankyou so much for pointing out the errors, really appreciated and I will make my code more clear.

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 this pull request may close these issues.

2 participants