From b00f57b11833250ed9bacc03be66441283cd883b Mon Sep 17 00:00:00 2001 From: r17x Date: Sat, 8 Jun 2024 01:07:04 +0700 Subject: [PATCH] feat(react): add isValidElement --- src/React.re | 3 +++ src/React.rei | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/React.re b/src/React.re index 45071cda2..397d92407 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 f24d7273f..be2445ec6 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";