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

Commit 75f649b

Browse files
committed
doc: Small doc fixes
1 parent 645eb66 commit 75f649b

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

src/edit-list.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type Props = {
2323
/**
2424
* Optionally pass an array of fields that should be editable
2525
*
26+
* ```
2627
* [
2728
* {
2829
* path: ['username'],
@@ -33,6 +34,7 @@ type Props = {
3334
* required: true,
3435
* }
3536
* ]
37+
* ```
3638
*/
3739
editFields?: Array<FieldConfig>
3840
/**
@@ -43,6 +45,7 @@ type Props = {
4345
/**
4446
* Labels to show in the list
4547
*
48+
* ```
4649
* [
4750
* {
4851
* label: 'Username',
@@ -53,15 +56,16 @@ type Props = {
5356
* path: ['password']
5457
* },
5558
* ]
59+
* ```
5660
*/
5761
labels: Labels
5862
/**
5963
* Callback when any field in the form is modified.
60-
* If this property is set, the form becomes a controlled component and the value
61-
* prop must be maintained externally.
64+
* If this property is set, the form becomes a controlled component
65+
* and the value prop must be maintained externally.
6266
*
63-
* This is useful if you nest multiple FormHelpers or need to restrict user input
64-
* before it appear on the screen.
67+
* This is useful if you nest multiple FormHelpers or need to
68+
* restrict user input before it appear on the screen.
6569
*/
6670
onChange: (updatedList) => void
6771
/**
@@ -70,7 +74,8 @@ type Props = {
7074
edit: any
7175
setEdit: Function
7276
/**
73-
* Set to true to only show error messages for fields that have been touched
77+
* Set to true to only show error messages for fields that
78+
* have been touched
7479
*/
7580
errorOnTouched?: boolean
7681
/**
@@ -112,6 +117,8 @@ const enhance = compose(
112117
/**
113118
* Component for displaying a list of items, which handles editing and removal.
114119
*
120+
* ##### Example
121+
* ```
115122
* const enhance = compose(
116123
* withState('user', 'setUser', [{username: 'test', password: 'test'}]),
117124
* withState('editUser', 'setEditUser', null),
@@ -144,6 +151,7 @@ const enhance = compose(
144151
* edit={editUser}
145152
* setEdit={setEditUser}
146153
* />
154+
* ```
147155
*/
148156
export const EditList = enhance(({
149157
value: list, onChange, labels, editFields, mapFields, edit, setEdit,

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"target": "es2015",
77
"lib": ["dom", "es5", "es2015", "es2016", "es2017"],
88
"jsx": "react",
9-
"moduleResolution": "node"
9+
"moduleResolution": "node",
10+
"outDir": "dist"
1011
},
1112
"include": [
1213
"src/**/*",

0 commit comments

Comments
 (0)