Skip to content

Commit 6531279

Browse files
author
Dustyn Blackmore
committed
Minor changes to README.md
1 parent 780e807 commit 6531279

1 file changed

Lines changed: 18 additions & 16 deletions

File tree

README.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ An input component to serve the common good.
1313
* [FAQ](#FAQ)
1414
* [Examples](#examples)
1515

16+
Additionally, you can check out one of the key features here;
17+
* [Validation](#validation)
18+
1619
## Installation
1720

1821
To install, you can use [npm](https://npmjs.org/) or [yarn](https://yarnpkg.com):
@@ -137,28 +140,16 @@ export default App;
137140
```
138141

139142
## Validation
140-
Oh gosh; how I wanted to/will eventually leave this out of the component. In its
141-
current state; this is an inbuilt and entirely custom to component feature.
142-
Validation, in it's pure form; isn't really built into HTML Inputs, nor should
143-
it ever be purely depended on for any form of 'backend' processing.
144-
145-
For now; the behavior was included to provide exposure to the validation
146-
error.
147-
148-
See; https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
149-
150-
So.. for now, against my personal preference, and the project goals; it's
151-
included.
152-
153-
This is how it works;
143+
For those interested in why this is included, please also see:
144+
[Notes On Validation](#validation%20notes)
154145

155146
Validation is a, or an array of, objects which contain a 'callback', and
156147
validation error message. This object is provided to the component via the
157148
'validation' prop.
158149

159150
The callback functions are passed the value of the triggered input, as
160-
provided by the (React Event)[https://reactjs.org/docs/handling-events.html].
161-
The return of the function, true or false, is used to determine the state of the
151+
provided by the [React Event](https://reactjs.org/docs/handling-events.html).
152+
The return of the function, (boolean) false or true, is used to determine the state of the
162153
component. If false; the validation error is rendered. If an array of validation
163154
is provided, and one fails - the component fails validation, however; only the
164155
failing validation object error message is shown.
@@ -190,3 +181,14 @@ As stated, as an array;
190181
```jsx
191182
validation={[validMaxLength(32), validMinLength(10)]}
192183
```
184+
185+
## Validation Notes
186+
Oh gosh; how I wanted to/will eventually leave this out of the component. In its
187+
current state; this is an inbuilt and entirely custom to component feature.
188+
Validation, in it's pure form; isn't really built into HTML Inputs, nor should
189+
it ever be purely depended on for any form of 'backend' processing.
190+
191+
For now; the behavior was included to provide exposure to the validation
192+
error.
193+
194+
See; https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input

0 commit comments

Comments
 (0)