UNPKG

@lexical/react

Version:

This package provides Lexical components and hooks for React applications.

10 lines (8 loc) 623 B
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ import{getExtensionDependencyFromEditor as t}from"@lexical/extension";import{ReactExtension as r}from"@lexical/react/ReactExtension";import{useEffect as e}from"react";import{jsx as o}from"react/jsx-runtime";function i({initialEditor:i,children:n}){e(()=>{let t=!1;return queueMicrotask(()=>{t=!0}),()=>{t&&i.dispose()}},[i]);const{Component:c}=t(i,r).output;return o(c,{children:n})}export{i as LexicalExtensionEditorComposer};