Skip to content

refactor: convert FormStatus from class to functional component#6935

Merged
tujoworker merged 11 commits intov11from
refactor/form-status-to-functional
Apr 5, 2026
Merged

refactor: convert FormStatus from class to functional component#6935
tujoworker merged 11 commits intov11from
refactor/form-status-to-functional

Conversation

@langz
Copy link
Copy Markdown
Contributor

@langz langz commented Mar 5, 2026

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 5, 2026

Branch Preview URL (stable):
https://refactor-form-status-to-func.eufemia-e25.pages.dev

https://refactor-form-status-to-func.eufemia-e25.pages.dev

Deployment URL (unique):
https://8af783e6.eufemia-e25.pages.dev

https://8af783e6.eufemia-e25.pages.dev

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci bot commented Mar 5, 2026

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.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 5, 2026

commit: d5505a6

@langz langz requested a review from tujoworker March 6, 2026 12:49
@langz langz force-pushed the refactor/form-status-to-functional branch 7 times, most recently from 4777f67 to 66fe7bb Compare March 16, 2026 09:10
@langz langz force-pushed the refactor/form-status-to-functional branch 5 times, most recently from 343f374 to 18e14e1 Compare March 19, 2026 08:36
Copy link
Copy Markdown
Member

@tujoworker tujoworker left a comment

Choose a reason for hiding this comment

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

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.

Comment thread packages/dnb-eufemia/src/components/form-status/FormStatus.tsx Outdated
Comment thread packages/dnb-eufemia/src/components/form-status/FormStatus.tsx
Comment thread packages/dnb-eufemia/src/components/form-status/FormStatus.tsx Outdated
Comment thread packages/dnb-eufemia/src/components/form-status/FormStatus.tsx Outdated
@langz
Copy link
Copy Markdown
Contributor Author

langz commented Mar 24, 2026

I'll rebase this with latest v11 to make sure that it's working as expected with that before merging.

@langz langz force-pushed the refactor/form-status-to-functional branch 2 times, most recently from c7da72a to d4448ee Compare March 26, 2026 12:55
langz added 10 commits April 5, 2026 09:32
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.
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
@tujoworker tujoworker force-pushed the refactor/form-status-to-functional branch from d4448ee to d5505a6 Compare April 5, 2026 07:42
@tujoworker tujoworker merged commit b7e3fb0 into v11 Apr 5, 2026
11 checks passed
@tujoworker tujoworker deleted the refactor/form-status-to-functional branch April 5, 2026 08:12
@tujoworker
Copy link
Copy Markdown
Member

Did test things manually. Worked as expected/before.

1 similar comment
@tujoworker
Copy link
Copy Markdown
Member

Did test things manually. Worked as expected/before.

tujoworker added a commit that referenced this pull request Apr 5, 2026
tujoworker added a commit that referenced this pull request Apr 5, 2026
tujoworker added a commit that referenced this pull request Apr 5, 2026
tujoworker added a commit that referenced this pull request Apr 6, 2026
tujoworker added a commit that referenced this pull request Apr 6, 2026
tujoworker added a commit that referenced this pull request Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants