Skip to content

Commit a181916

Browse files
authored
Merge pull request #8 from react-hook-form/fix/readme-code-formate
Fix/readme code formate
2 parents 8cf9e46 + 257ae68 commit a181916

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ $ npm install @hookform/error-message
2828

2929
## Quickstart
3030

31-
### Single Error Message
31+
- Single Error Message
3232

3333
```jsx
3434
import React from 'react';
@@ -62,7 +62,9 @@ export default function App() {
6262
}
6363
```
6464

65-
### Multiple Error Messages
65+
---
66+
67+
- Multiple Error Messages
6668

6769
```jsx
6870
import React from 'react';
@@ -110,13 +112,13 @@ export default function App() {
110112

111113
## API
112114

113-
| Prop | Type | Required | Description |
114-
| :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
115-
| `name` | string | | associated field name. |
116-
| `errors` | object | | errors object from React Hook Form. It's optional if you are using `FormProvider`. |
117-
| `message` | string \| React.ReactElement | | inline error message. |
118-
| `as` | string \|<br>React.ReactElement \| <br>React.ComponentType | | Wrapper component or HTML tag. eg: `as="p"`, `as={<p />}` or `as={CustomComponent}` |
119-
| `render` | (payload: {<br>&nbsp;&nbsp;message: string \| React.ReactElement;<br>&nbsp;&nbsp;messages?: Record<<br>&nbsp;&nbsp;&nbsp;&nbsp;string,<br>&nbsp;&nbsp;&nbsp;&nbsp;(string \| React.ReactElement \| boolean \| undefined)[]<br>&nbsp;&nbsp;>;<br>}) => React.ReactNode | | This is a [render prop](https://reactjs.org/docs/render-props.html) for rendering error message or messages. <br>Note: you need to set `criteriaMode` to `all` for using messages. |
115+
| Prop | Type | Required | Description |
116+
| :-------- | :---------------------------------------------------- | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
117+
| `name` | `string` | | Associated field name. |
118+
| `errors` | `object` | | `errors` object from React Hook Form. It's optional if you are using `FormProvider`. |
119+
| `message` | `string \| React.ReactElement` | | inline error message. |
120+
| `as` | `string \| React.ReactElement \| React.ComponentType` | | Wrapper component or HTML tag. eg: `as="p"`, `as={<p />}` or `as={CustomComponent}` |
121+
| `render` | `Function` | | This is a [render prop](https://reactjs.org/docs/render-props.html) for rendering error message or messages. <br><b>Note:</b> you need to set `criteriaMode` to `all` for using messages. |
120122

121123
## Backers
122124

0 commit comments

Comments
 (0)