open-sauced / hot

πŸ•The site that recommends the hottest projects on GitHub.
https://hot.opensauced.pizza
MIT License
426 stars 148 forks source link

Feature: useRef instead of querySelector in repoSubmission #311

Closed bdougie closed 2 years ago

bdougie commented 2 years ago

Type of feature

πŸ§‘β€πŸ’» Refactor

Current behavior

Noticed in #310 that we are using a query selector in the RepoSubmission. We shouldn't do that.

https://github.com/open-sauced/hot/blob/beta/src/components/RepoSubmission.tsx#L64

Suggested solution

Instead useRef works better and provides an elegant React solution.

ref.current.focus

Additional context

No response

Code of Conduct

Contributing Docs

ddsuhaimi commented 2 years ago

.take

github-actions[bot] commented 2 years ago

Thanks for taking this on! If you have not already, join the conversation in our Discord

ddsuhaimi commented 2 years ago

@bdougie I think using useOutsideClickRef from 'rooks' could be a better solution. Let me know what you think :)

0-vortex commented 2 years ago

@bdougie I think using useOutsideClickRef from 'rooks' could be a better solution. Let me know what you think :)

I second this! πŸ’―

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 2.24.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: