Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit c177513

Browse files
committed
Updating documentation
1 parent e4f37cc commit c177513

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

docs/guides/custom-controls.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class MyCustomInput extends React.Component {
3131

3232
However, this can get a bit tedious, especially for complex controls. Thankfully, there's an easier way.
3333

34-
## Custom Controls with `<Control>`
34+
## Standard Custom Controls with `<Control>`
3535

3636
With the `<Control>` component, a custom component can be passed into the `component={...}` prop, and standard control props and event handlers (such as `onChange`, `onBlur`, `onFocus`, `value`, etc.) will be mapped as expected:
3737

@@ -84,6 +84,21 @@ By default, any props on `<Control>` that are _not_ part of the `Control.propTyp
8484
/>
8585
```
8686

87+
## Special Custom Controls with `<Control.custom>`
88+
89+
If you do _not_ want any standard property mappings (such as `onChange`, `onBlur`, etc.) passed down to your custom control component, use `<Control.custom>` and define your own mappings:
90+
91+
```jsx
92+
<Control.custom
93+
component={SpecialCustomText}
94+
mapProps={{
95+
onTextChange: (props) => props.onChange,
96+
onLoseFocus: (props) => props.onBlur,
97+
// etc.
98+
}}
99+
/>
100+
```
101+
87102
## Model and View Values
88103

89104
One important thing to keep in mind is that there is no single `value` for a `<Control>`; rather, there are two types of values (that are equivalent, more often than not):

0 commit comments

Comments
 (0)