Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
types: allow assigning OpaqueColorValue as a color (#6481)
The new react-native color typings (rn 63+) look like: declare const OpaqueColorValue: unique symbol; type OpaqueColorValue = typeof OpaqueColorValue; export type ColorValue = string | OpaqueColorValue; Since we can't import any of those yet without breaking backwards compatibility (library consumer would have to have rn63 types), this PR instead types Color as string or generic symbol. We can't use unique symbol as that would require a reference to OpaqueColorValue. This is a bit hacky as library consumers could potentially assign any symbol to Color without getting an typescript error but that is rather unlikely. Color should now be assigned the regular string colors or PlatformColor or DynamicColorIOS. Co-authored-by: Guy Carmeli <guyca@users.noreply.github.com>
- Loading branch information