Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

refactor: add useForm hook#3159

Merged
a-b-r-o-w-n merged 10 commits intomasterfrom
abrown/chore/use-form-hook
May 29, 2020
Merged

refactor: add useForm hook#3159
a-b-r-o-w-n merged 10 commits intomasterfrom
abrown/chore/use-form-hook

Conversation

@a-b-r-o-w-n
Copy link
Contributor

Description

We have various forms through out the client app which all handle validation in similar ways. I have been thinking we need a form hook for a while so I decided to whip up something as a POC.

Task Item

#minor

@boydc2014
Copy link
Contributor

Looks neat, @liweitian please check this out

const createConfig = require('./createConfig');

module.exports = testingLib;
module.exports.hooks = hooksLib;
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 would like to have done something like

import { act } from '@bfc/test-utils/hooks'`

But I couldn't figure out how to expose that in the typings correctly. If anyone has some TS wizardry, I would appreciate.

@a-b-r-o-w-n a-b-r-o-w-n requested a review from srinaath May 29, 2020 16:28
@coveralls
Copy link

coveralls commented May 29, 2020

Coverage Status

Coverage decreased (-0.006%) to 41.69% when pulling 40012e5 on abrown/chore/use-form-hook into cdb33b7 on master.

@a-b-r-o-w-n
Copy link
Contributor Author

Going to merge this to get the hooks testing utils.

@a-b-r-o-w-n a-b-r-o-w-n merged commit 10c809a into master May 29, 2020
@a-b-r-o-w-n a-b-r-o-w-n deleted the abrown/chore/use-form-hook branch May 29, 2020 17:57
lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
* add react-hooks testing lib

* add useForm hook

* use useForm in a couple of forms

* remove comment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants