Skip to content

Extract common React hooks to package#6174

Merged
aduth merged 1 commit intomainfrom
aduth-hooks-package
Apr 7, 2022
Merged

Extract common React hooks to package#6174
aduth merged 1 commit intomainfrom
aduth-hooks-package

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Apr 7, 2022

Why: Preparatory work ahead of upcoming FlowStateMachine v2 work, where it's expected a new form-steps package would need to share usage of these hooks with the existing document-capture package.

**Why:** Preparatory work ahead of upcoming FlowStateMachine v2 work, where it's expected a new form-steps package would need to share usage of these hooks with the existing document-capture package.

[skip changelog]
@aduth aduth requested review from nprimak, peggles2 and solipet April 7, 2022 13:08
Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -0,0 +1,3 @@
# `@18f/identity-react-hooks`

A collection of general-purpose [React hooks](https://reactjs.org/docs/hooks-intro.html).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth documenting the hooks in the README with examples? Or realistically these are internal so we should just look for internal usage?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm conflicted, because on one hand, yes, it would be great to have documented examples. On the other hand, my experience is that those sorts of documentation fall out of sync with the implementation almost immediately. Ideally it would be something where we could generate the documentation out of the source code, but I'm not aware of any tooling that would produce what we'd want.

The main goal with including this was to try to be marginally better about documenting the purpose of each package for other developers on the team, so at least it's incrementally better in that regard 😅

@aduth aduth merged commit 4429c8f into main Apr 7, 2022
@aduth aduth deleted the aduth-hooks-package branch April 7, 2022 15:25
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