Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use conditional type to flattern RN styles (facebook#41931)
Summary: Pull Request resolved: facebook#41931 `GenericStyleProp` is defined as ``` type GenericStyleProp<+T> = | null | void | T | false | '' | $ReadOnlyArray<GenericStyleProp<T>>; ``` and `____FlattenStyleProp_Internal` is designed to reverse it. We can use conditional type to achieve it instead of $Call: `null | void | false | ''` doesn't contribute to anything doing reversal, so they are mapped to empty. When we encounter $ReadOnlyArray, we recursively apply `____FlattenStyleProp_Internal`. Otherwise, we return the input type. Changelog: [Internal] Reviewed By: jbrown215 Differential Revision: D52142082 fbshipit-source-id: 590c71c6400498730675e20c67b173c3bc285d00
- Loading branch information