Граф коммитов

6 Коммитов

Автор SHA1 Сообщение Дата
Logan Daniels 9127fb51fc Manual fixes for xplat/js/react-native-github
Summary:
Need to add explicit type annotations in these areas to unblock types-first architecture for Flow. These are locations the codemod could not automatically handle.

I'll call out areas I need a close eye on in the comments.

Reviewed By: panagosg7

Differential Revision: D16659053

fbshipit-source-id: 167dd2abe093019b128676426374c1c62cf71e7f
2019-08-09 10:11:15 -07:00
Michał Osadnik 61e95e5cbf Force WithDefault not to be an optional value
Summary:
`WithDefault` appears not to be required to be prefixed with `?` because it's option value per se.

Fixed tests, removed `?` where needed, updated snapshots and review them. Added mechanism fro throwing error when `?WithDefault` found. Add tests for it.

Reviewed By: rubennorte

Differential Revision: D16048463

fbshipit-source-id: f55ed7454aacf0b8c42944a9b5c1037ad1b360fe
2019-07-02 03:30:55 -07:00
Michał Osadnik 0f83dfab8e Transform BubbleEvent and DirectEvent into DirectEventHandler and BubblingEventHandler
Summary:
It appears that `(e: BubblingEvent<T>) = mixed` exists only in given context and it's pointless to keep in this way. It could be simplified to `BubblingEventHandler<T>` without any negative consequences and that's the motivation of this diff.

The only tradeoff of this decision is leaving an opportunity to declare Bubbling/Direct event in the top of the file bc then analysing the code becomes much more difficult. However, it's not used anywhere so it's not a problem now and probably any time.

Also, changes the names to `DirectEventHandler` and `BubblingEventHandler` which are more related to current state. The names were updated in many places in code.

Reviewed By: rubennorte

Differential Revision: D16054571

fbshipit-source-id: 741d075eb46b80bac8eb73a6b30fc0b448cb3902
2019-07-01 05:13:53 -07:00
Cameron Bourke 680abf2d56 Move to SegmentedControlIOS to use a generated view config
Summary:
## Context
Moving SegmentedControlIOS to use a generated view config.

 ---

It's worth mentioning that even though `RCTSegmentedControlNativeComponent` defines a different event type to that of `RCTView`. We currently do not have 100%  type safety for the event types in Paper. In other words, when an event for `onChange` in this case comes from the native side, it could potentially be shaped differently than what was typed in the native component file. This will be addressed in `Fabric`.
```
// RCTSegmentedControlNativeComponent.js
export type Event = $ReadOnly<{|
  value: Int32,
  selectedSegmentIndex: Int32,
|}>;
...
export type NativeProps = $ReadOnly<{|
  ...
  onChange?: ?(event: BubblingEvent<Event>) => mixed,
|}>
```
This means that in the view config diff, there will be a value of `none` for `bubblingEventTypes`

Reviewed By: rickhanlonii

Differential Revision: D15851692

fbshipit-source-id: 6653fe7a77e46afdd55808aa5a4df813b34d7f70
2019-06-24 02:03:31 -07:00
James Ide 0ee5f68929 Migrate "Libraries" from Haste to standard path-based requires (sans vendor & renderers) (#24749)
Summary:
This is the next step in moving RN towards standard path-based requires. All the requires in `Libraries` have been rewritten to use relative requires with a few exceptions, namely, `vendor` and `Renderer/oss` since those need to be changed upstream. This commit uses relative requires instead of `react-native/...` so that if Facebook were to stop syncing out certain folders and therefore remove code from the react-native package, internal code at Facebook would not need to change.

See the umbrella issue at https://github.com/facebook/react-native/issues/24316 for more detail.

[General] [Changed] - Migrate "Libraries" from Haste to standard path-based requires
Pull Request resolved: https://github.com/facebook/react-native/pull/24749

Differential Revision: D15258017

Pulled By: cpojer

fbshipit-source-id: a1f480ea36c05c659b6f37c8f02f6f9216d5a323
2019-05-08 08:48:59 -07:00
John.Yang 378892bc0d RCTSegmentedControl (#23000)
Summary:
Changelog:
----------

[iOS] [Changed] -  follow #22990, move the call to requireNativeComponent from `SegmentedControlIOS.ios.js` to `RCTSegmentedControlNativeComponent.js`
Pull Request resolved: https://github.com/facebook/react-native/pull/23000

Differential Revision: D13697168

Pulled By: TheSavior

fbshipit-source-id: 83a66279d2fcd5a29d2ebc9cf5b5273947d96281
2019-01-16 14:00:00 -08:00