Skip to content
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

feat(Form.useData): add hook to get forms data outside of the context #3218

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

tujoworker
Copy link
Member

@tujoworker tujoworker commented Jan 12, 2024

How to use it:

import { Form } from '@dnb/eufemia/extensions/forms'
function Component() {
  const { data, update } = Form.useData('unique', initialData = undefined)

  return (
    <Form.Handler
      id="unique"
      ...
    >
      ...
    </Form.Handler>
  )
}

Copy link

vercel bot commented Jan 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
eufemia ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 16, 2024 8:02am

@tujoworker tujoworker changed the title feat(Form.useData): add data handler to get forms data outside of the… feat(Form.useData): add data handler to get forms data outside of the context Jan 12, 2024
@tujoworker tujoworker marked this pull request as draft January 12, 2024 10:30
Copy link

codesandbox-ci bot commented Jan 12, 2024

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.

Latest deployment of this branch, based on commit c6caf15:

Sandbox Source
eufemia-starter Configuration

Copy link
Contributor

@joakbjerk joakbjerk left a comment

Choose a reason for hiding this comment

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

Noice! 🙏

@tujoworker tujoworker merged commit 58c77cd into main Jan 16, 2024
10 checks passed
@tujoworker tujoworker deleted the feat/use-data branch January 16, 2024 12:37
tujoworker pushed a commit that referenced this pull request Jan 16, 2024
## [10.18.0](v10.17.0...v10.18.0) (2024-01-16)

### ✨ Features

* **Form.useData:** add hook to get forms data outside of the context ([#3218](#3218)) ([58c77cd](58c77cd))

### 🐛 Bug Fixes

* **Expiry:** validation logic ([#3216](#3216)) ([beff8e8](beff8e8))
* **Field.Expiry:** correct disabled styling ([#3215](#3215)) ([2a0651a](2a0651a))
* **Field.Number:** use default size ([#3229](#3229)) ([348f3cb](348f3cb))
* **Field.PhoneNumber:** ensure data value is used when given ([#3222](#3222)) ([1e37cf6](1e37cf6))
* **NumberFormat:** setting selectall to false will no longer select all ([#3213](#3213)) ([ab5cea2](ab5cea2))
* **ToggleButton:** add checked disabled style ([#3224](#3224)) ([c3ea6a6](c3ea6a6))
* **VisuallyHidden:** remove flex support ([#3219](#3219)) ([2fd5c41](2fd5c41))
@tujoworker
Copy link
Member Author

🎉 This PR is included in version 10.18.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants