Skip to content

Context should not be used in custom hook, useFile.js #123

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

Closed
klappy opened this issue Jan 26, 2022 · 1 comment
Closed

Context should not be used in custom hook, useFile.js #123

klappy opened this issue Jan 26, 2022 · 1 comment
Assignees

Comments

@klappy
Copy link
Contributor

klappy commented Jan 26, 2022

const { actions: { updateBranch }, config: repositoryConfig } = useContext(RepositoryContext);

In the above custom hook, the context is referenced and should be abstracted and props from the context passed in instead.
The current implementation inappropriately requires context to be used but all other hooks are usable without the use of contexts.

Don't worry, I checked git blame and it was my doing :D

DoD:.

Full regression test needed. App should work as expected previously.

@klappy klappy self-assigned this Jan 26, 2022
@klappy
Copy link
Contributor Author

klappy commented Jan 26, 2022

Also happening in ApplicationBar.js

const { state: file } = useContext(FileContext)

@BincyJ BincyJ closed this as completed May 31, 2022
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

No branches or pull requests

2 participants