mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-21 08:22:45 +08:00
Flow strict TextInput (#22250)
Summary: Related to #22100 Enhance TextInput with callback event types. This is a first draft and I will need more help on this one. Flow checks are successful now but I am not sure types are accurate though. Moreover I find my separation approach kind of dirty for callback event types. - All flow tests succeed. [GENERAL] [ENHANCEMENT] [TextInput.js] - Flow types [GENERAL] [ENHANCEMENT] [TextInputExample.android.js] - Fixing Flow types [GENERAL] [ENHANCEMENT] [TextInputExample.ios.js] - Fixing Flow types [GENERAL] [ENHANCEMENT] [XHRExampleFetch.js] - Fixing Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/22250 Reviewed By: TheSavior Differential Revision: D13104820 Pulled By: RSNara fbshipit-source-id: 3fbb98d0ec2b62be676f71ae1053933d9c78485e
This commit is contained in:
committed by
Facebook Github Bot
parent
79274979b7
commit
35a65cd704
@@ -71,7 +71,7 @@ class TextEventsExample extends React.Component<{}, $FlowFixMeState> {
|
||||
'onSelectionChange range: ' +
|
||||
event.nativeEvent.selection.start +
|
||||
',' +
|
||||
event.nativeEvent.selection.end,
|
||||
(event.nativeEvent.selection.end || ''),
|
||||
)
|
||||
}
|
||||
onKeyPress={event => {
|
||||
@@ -348,10 +348,10 @@ class BlurOnSubmitExample extends React.Component<{}> {
|
||||
}
|
||||
|
||||
type SelectionExampleState = {
|
||||
selection: {|
|
||||
selection: $ReadOnly<{|
|
||||
start: number,
|
||||
end?: number,
|
||||
|},
|
||||
|}>,
|
||||
value: string,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user