mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Add Slider and Switch
Summary: This diff turns on codegen for Slider and Switch Reviewed By: TheSavior Differential Revision: D15738544 fbshipit-source-id: a0dfb5b05fd62f28fc3865855986e49598dd5e19
This commit is contained in:
1 parent
d8bacc28f6
commit
a3b9840885
5 files changed
+8
-4
No files matched your search
@@ -11,7 +11,7 @@
|
||||
'use strict';
|
||||
|
||||
const Platform = require('../../Utilities/Platform');
|
||||
const SliderNativeComponent = require('./SliderNativeComponent');
|
||||
import SliderNativeComponent from './SliderNativeComponent';
|
||||
const React = require('react');
|
||||
const ReactNative = require('../../Renderer/shims/ReactNative');
|
||||
const StyleSheet = require('../../StyleSheet/StyleSheet');
|
||||
|
||||
@@ -53,7 +53,7 @@ type NativeProps = $ReadOnly<{|
|
||||
onSlidingComplete?: ?(event: DirectEvent<Event>) => void,
|
||||
|}>;
|
||||
|
||||
module.exports = codegenNativeComponent<NativeProps>('Slider', {
|
||||
export default codegenNativeComponent<NativeProps>('Slider', {
|
||||
interfaceOnly: true,
|
||||
isDeprecatedPaperComponentNameRCT: true,
|
||||
});
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const SwitchNativeComponent = require('./SwitchNativeComponent');
|
||||
import SwitchNativeComponent from './SwitchNativeComponent';
|
||||
const AndroidSwitchNativeComponent = require('./AndroidSwitchNativeComponent');
|
||||
const Platform = require('../../Utilities/Platform');
|
||||
const React = require('react');
|
||||
|
||||
@@ -39,6 +39,6 @@ type NativeProps = $ReadOnly<{|
|
||||
onChange?: ?(event: BubblingEvent<SwitchChangeEvent>) => mixed,
|
||||
|}>;
|
||||
|
||||
module.exports = codegenNativeComponent<NativeProps>('Switch', {
|
||||
export default codegenNativeComponent<NativeProps>('Switch', {
|
||||
isDeprecatedPaperComponentNameRCT: true,
|
||||
});
|
||||
@@ -106,6 +106,10 @@ export function getConfigWithoutViewProps(
|
||||
viewConfig: ReactNativeBaseComponentViewConfig<>,
|
||||
propName: string,
|
||||
) {
|
||||
if (!viewConfig[propName]) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return Object.keys(viewConfig[propName])
|
||||
.filter(prop => !ReactNativeViewViewConfig[propName][prop])
|
||||
.reduce((obj, prop) => {
|
||||
|
||||
Reference in new issue
Block a user