Skip to content

Commit fde9eaa

Browse files
jonathanjJonathan Jacobs
andauthored
🤖 Merge PR DefinitelyTyped#72588 [react-native-web] Declare and export unstable_createElement by @jonathanj
Co-authored-by: Jonathan Jacobs <[email protected]>
1 parent 220dafe commit fde9eaa

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

‎types/react-native-web/index.d.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type {
22
ComponentClass,
33
ComponentType,
4+
createElement,
45
CSSProperties,
56
FocusEventHandler,
67
FunctionComponent,
@@ -1258,6 +1259,10 @@ export function useWindowDimensions(): {
12581259
width: number;
12591260
};
12601261

1262+
// unstable APIs
1263+
1264+
export const unstable_createElement: typeof createElement;
1265+
12611266
export {};
12621267

12631268
declare module "react-native" {

‎types/react-native-web/react-native-web-tests.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ import {
4242
TouchableNativeFeedback,
4343
TouchableOpacity,
4444
TouchableWithoutFeedback,
45+
// unstable APIs
46+
unstable_createElement,
4547
// hooks
4648
useColorScheme,
4749
useLocaleContext,
@@ -382,6 +384,9 @@ const colorScheme = useColorScheme();
382384
const localeContext = useLocaleContext();
383385
const windowDimensions = useWindowDimensions();
384386

387+
// Unstable APIs
388+
const videoElement = unstable_createElement("video", { src: "a_url", controls: true, muted: "arst" });
389+
385390
const node = 0;
386391
UIManager.blur(node);
387392
UIManager.focus(node);

0 commit comments

Comments
 (0)