Skip to content

Commit

Permalink
update docs for referenceKey
Browse files Browse the repository at this point in the history
  • Loading branch information
wcastand committed Oct 9, 2017
1 parent 2ea68ed commit 2c61589
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/HOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ export default enhance(MyCustomComponent)
`Array<Option>`
`Option: { label: string, value: any }`

##### referenceKey - string
Key use to test equality and to render input value (default: 'value').

##### searchValue - string
Current value of the search input.

Expand Down
3 changes: 3 additions & 0 deletions docs/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ It's accepting a lot of props :
| `onChange` | `function` | no | - | Called when the value if changed, usefull for state management | selected Option(s) |
| `placeholder` | `string` | no | "Select an options" | Placeholder for the select label | |
| `renderInputs` | `function` | no | - | Override the function used to render the inputs in the DOM | selectedOption, name |
| `referenceKey` | `string` | no | "value" | Allow to use a custom key for value | |
| `stayOpenOnSelect` | `boolean` | no | false | Allow to let the list open after a value is selected | |
| `style` | `Object` | no | - | style the component (React prop) | |
| `transform` | `function` | no | - | Function used to format/transform the options | Option |
Expand Down Expand Up @@ -63,4 +64,6 @@ You can return a promise instead of using the callback:
| `value` | `any` | value used for the input of the Select |

The Option type above is the default used by `selectless`.
By default the reference is "value". You can change that with the prop : `referenceKey`.

If you need to change the format and the props, don't forget to change the functions `clearOneValue` and `renderInputs`.

0 comments on commit 2c61589

Please sign in to comment.