mirror of
https://github.com/status-im/react-native.git
synced 2025-02-26 08:05:34 +00:00
Minor documentation correction for exposing native iOS components
Summary: Minor documentation correction for the native components iOS API section. Before: "Sometimes your native component will have some special properties that you don't want to them to be part of the API" After: "Sometimes your native component will have some special properties that you don't want to be part of the API" Confirm section renders correctly via markdown. Closes https://github.com/facebook/react-native/pull/15914 Reviewed By: TheSavior Differential Revision: D5817146 Pulled By: buymeasoda fbshipit-source-id: 075441cf7f5f23a4ca512bae48ca8fc319762b1e
This commit is contained in:
parent
915a020fca
commit
3ceb20de74
@ -244,7 +244,7 @@ render() {
|
||||
|
||||
Here you can see that the shape of the region is explicit in the JS documentation - ideally we could codegen some of this stuff, but that's not happening yet.
|
||||
|
||||
Sometimes your native component will have some special properties that you don't want to them to be part of the API for the associated React component. For example, `Switch` has a custom `onChange` handler for the raw native event, and exposes an `onValueChange` handler property that is invoked with just the boolean value rather than the raw event. Since you don't want these native only properties to be part of the API, you don't want to put them in `propTypes`, but if you don't you'll get an error. The solution is simply to add them to the `nativeOnly` option, e.g.
|
||||
Sometimes your native component will have some special properties that you don't want to be part of the API for the associated React component. For example, `Switch` has a custom `onChange` handler for the raw native event, and exposes an `onValueChange` handler property that is invoked with just the boolean value rather than the raw event. Since you don't want these native only properties to be part of the API, you don't want to put them in `propTypes`, but if you don't you'll get an error. The solution is simply to add them to the `nativeOnly` option, e.g.
|
||||
|
||||
```javascript
|
||||
var RCTSwitch = requireNativeComponent('RCTSwitch', Switch, {
|
||||
|
Loading…
x
Reference in New Issue
Block a user