Skip to content

@hookform/error-message#7

Merged
kotarella1110 merged 25 commits intomasterfrom
new
Jun 16, 2020
Merged

@hookform/error-message#7
kotarella1110 merged 25 commits intomasterfrom
new

Conversation

@kotarella1110
Copy link
Copy Markdown
Member

@kotarella1110 kotarella1110 commented Jun 11, 2020

remove ErrorMessage component from core lib in v6 (react-hook-form/react-hook-form#1471).
move back to its this repo.

Reason: TS support is getting better with optional chaining and we could trim some size off our lib size without impacting the end-user experience of rendering errors

See this issue (react-hook-form/react-hook-form#1840) for more detail.

- import { ErrorMessage } from 'react-hook-form';
+ import { ErrorMessage } from '@hookform/error-message'

- <ErrorMessage errors={errors} name="error">
-   {({ message }) => <p>{message}</p>}
- </ErrorMessage>
+ <ErrorMessage
+   errors={errors}
+   name="error"
+   render={({ message }) => <p>{message}</p>}
+ />

Comment thread package.json
Comment on lines +29 to +33
"keywords": [
"react",
"hooks",
"react-hooks"
],
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@bluebill1049 What are the keywords here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

for SEO :)

Comment thread src/types.ts Outdated
Comment on lines +1 to +8
import {
FieldErrors,
FieldName,
Message,
MultipleFieldErrors,
AsProps,
Assign,
} from 'react-hook-form';
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@bluebill1049 Should I fix core lib to export types?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i think we can duplicate those types here if they are not essential for users. what do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this component probably not going to be touched after release for a while.

Comment thread package.json
Comment on lines +29 to +39
"keywords": [
"react",
"react-component",
"form",
"forms",
"form-validation",
"validation",
"hookform",
"react-hook-form",
"typescript"
],
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@bluebill1049 What do you think this keywords?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks great.

Comment thread rollup.config.js Outdated
{
input: 'src/index.tsx',
output: {
name: 'HookFormErrorMessage',
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@bluebill1049 What do you think this umd global naming?
HookFormErrorMessage vs ErrorMessage

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ReactHookFormErrorMessage ? keep consistent?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done!

Copy link
Copy Markdown
Member

@bluebill1049 bluebill1049 left a comment

Choose a reason for hiding this comment

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

Awesome! Nice ErrorMessage! let's publish it.

@kotarella1110
Copy link
Copy Markdown
Member Author

yea! I will publish it! 🚀
is this version 0.0.1 OK?

@bluebill1049
Copy link
Copy Markdown
Member

sounds good @kotarella1110 🚀

@kotarella1110 kotarella1110 changed the title @hookform/error-message v1 @hookform/error-message Jun 16, 2020
@kotarella1110 kotarella1110 merged commit 693d486 into master Jun 16, 2020
@kotarella1110 kotarella1110 deleted the new branch June 16, 2020 06:40
@kotarella1110
Copy link
Copy Markdown
Member Author

🎉 This PR is included in version 0.0.1 🎉
https://www.npmjs.com/package/@hookform/error-message

@bluebill1049
Copy link
Copy Markdown
Member

awesome!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2021

🎉 This PR is included in version 1.1.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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants