Skip to content

Commit

Permalink
Replace React utility types using $ with the namespaced ones
Browse files Browse the repository at this point in the history
  • Loading branch information
SamChou19815 authored and necolas committed Oct 16, 2024
1 parent f0997db commit 13f3958
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/react-strict-dom/src/native/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ type StylesWithout<T> = StyleXStylesWithout<T>;
type ProviderValue = $ReadOnly<{ [string]: string | number }>;

type ProviderProps = $ReadOnly<{
children: React$MixedElement,
children: React.MixedElement,
customProperties: ProviderValue
}>;

function ThemeProvider(props: ProviderProps): React$MixedElement {
function ThemeProvider(props: ProviderProps): React.MixedElement {
const { children, customProperties } = props;

return customProperties ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import * as React from 'react';
import { __customProperties } from '../stylex';

const defaultContext = __customProperties;
const ContextCustomProperties: React$Context<CustomProperties> =
const ContextCustomProperties: React.Context<CustomProperties> =
React.createContext(defaultContext);

if (__DEV__) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import * as React from 'react';
type Value = 'flow' | 'flex';

const defaultContext = 'flow';
const ContextDisplayInside: React$Context<Value> =
const ContextDisplayInside: React.Context<Value> =
React.createContext(defaultContext);

if (__DEV__) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import { shallowEqual } from './shallowEqual';
type Value = Style;

type ProviderProps = $ReadOnly<{
children: React$MixedElement,
children: React.MixedElement,
value: Value
}>;

const defaultContext = {};
const ContextInheritedStyles: React$Context<Value> =
const ContextInheritedStyles: React.Context<Value> =
React.createContext(defaultContext);

if (__DEV__) {
Expand All @@ -33,7 +33,7 @@ if (__DEV__) {
// The 'em' unit polyfill in stylex assumes the inherited fontSize is always a computed number.
export function ProvideInheritedStyles(
props: ProviderProps
): React$MixedElement {
): React.MixedElement {
const { children, value } = props;
const inheritedStyles = useInheritedStyles();
const flatStyle = useMemo(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-strict-dom/src/native/modules/TextString.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Props = $ReadOnly<{|
children: string
|}>;

export function TextString(props: Props): React$MixedElement {
export function TextString(props: Props): React.MixedElement {
const { children } = props;

const customProperties = useCustomProperties();
Expand Down
2 changes: 1 addition & 1 deletion packages/react-strict-dom/src/types/StrictReactDOMProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ export type StrictReactDOMProps = $ReadOnly<{
| 'characters'
),
autoFocus?: ?boolean,
children?: React$Node,
children?: React.Node,
'data-testid'?: ?string,
dir?: ?('auto' | 'ltr' | 'rtl'),
elementTiming?: ?string,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-strict-dom/src/types/react-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type Props = {
animated?: ?boolean, // non-standard
caretHidden?: TextInputProps['caretHidden'],
cursorColor?: TextInputProps['cursorColor'],
children?: ?React$Node,
children?: ?React.Node,
crossOrigin?: ImageProps['crossOrigin'],
defaultValue?: TextInputProps['defaultValue'],
disabled?: ?boolean,
Expand Down

0 comments on commit 13f3958

Please sign in to comment.