From 88a4fde4cfa3001edd6a5905cf22530dc0257ca3 Mon Sep 17 00:00:00 2001 From: RiN Date: Wed, 17 Jul 2024 14:06:12 +0700 Subject: [PATCH] feat(react): add isValidElement (#837) --- src/React.re | 3 +++ src/React.rei | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/React.re b/src/React.re index 33d1c3451..cb2ef44f7 100644 --- a/src/React.re +++ b/src/React.re @@ -318,6 +318,9 @@ external component: componentLike('props, element) => component('props) = external createElement: (component('props), 'props) => element = "createElement"; +[@mel.module "react"] +external isValidElement: element => bool = "isValidElement"; + [@mel.module "react"] external cloneElement: (element, 'props) => element = "cloneElement"; diff --git a/src/React.rei b/src/React.rei index 7f2f91273..d939f38d7 100644 --- a/src/React.rei +++ b/src/React.rei @@ -16,6 +16,9 @@ external component: componentLike('props, element) => component('props) = external createElement: (component('props), 'props) => element = "createElement"; +[@mel.module "react"] +external isValidElement: element => bool = "isValidElement"; + [@mel.module "react"] external cloneElement: (element, 'props) => element = "cloneElement";