refactor: convert FormStatus from class to functional component#6935
refactor: convert FormStatus from class to functional component#6935tujoworker merged 11 commits intov11from
Conversation
|
Branch Preview URL (stable): Deployment URL (unique): |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
commit: |
4777f67 to
66fe7bb
Compare
343f374 to
18e14e1
Compare
tujoworker
left a comment
There was a problem hiding this comment.
This PR needs manual testing for the width handling. From my experience, width tests with JSDom is not always the same as in a browser.
I was not able to test it manually at the moment.
|
I'll rebase this with latest v11 to make sure that it's working as expected with that before merging. |
c7da72a to
d4448ee
Compare
The useMemo for id had an empty dependency array, causing the FormStatus id to never update when the parent component changed the id prop. This fixes the FieldBlock test that verifies aria-describedby uses forId when provided.
…eEffect in FormStatus
The fillCache callback had ownProps (a new object each render) in its dependency array, causing unnecessary re-creation every render. Since fillCache is only called from effects (useMountEffect/useUpdateEffect), reading from a ref is safe — it will always have the current value by the time effects run.
- Replace `restOfProps as any` with proper destructuring from typed rest
- Replace `{...params as any}` with typed Record<string, unknown> for params
- Replace `context as Record<string, any>` with proper context property access
- Import FormElementProps for typed globalStatus context access
d4448ee to
d5505a6
Compare
|
Did test things manually. Worked as expected/before. |
1 similar comment
|
Did test things manually. Worked as expected/before. |
Co-authored-by: Tobias Høegh <tobias@tujo.no>
Co-authored-by: Tobias Høegh <tobias@tujo.no>
Co-authored-by: Tobias Høegh <tobias@tujo.no>
Co-authored-by: Tobias Høegh <tobias@tujo.no>
Co-authored-by: Tobias Høegh <tobias@tujo.no>
Co-authored-by: Tobias Høegh <tobias@tujo.no>
No description provided.