New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

empty-ghost

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

empty-ghost

该组件允许开发者在不影响页面布局的情况下插入内容,同时通过 React 的 ref 功能获取到其子元素的真实 DOM 并且事件传递

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
0
Created
Source

empty-ghost

该组件允许开发者在不影响页面布局的情况下插入内容,同时通过 React 的 ref 功能获取到其子元素的真实 DOM 并且事件传递

NPM Version  NPM Version  unpacked size  Author

📦 Installation

npm install empty-ghost

🔨 Usage

/**EmptyGhost Demo**/
import Ghost from "empty-ghost";
/**
 * The function of the EmptyGhost is to render not only children, but also click events in the proxy children
 * It is equivalent to rendering < div > {children} < / div > but deleting the div after the first rendering
 **/
export function App() {

    return (
        <Ghost
            ref={(ref)=>{
                console.log('You will get the divs ref !!!',ref);
            }}
            onClick={(e)=>{
                console.log('any event you can add to EmptyGhost ',e);
            }}
        >
            <div>123</div>
        </Ghost>
    );
}

🖥️

🏠 Exports

参数类型
📒EmptyGhostPropsInterfaces
🎗️defaultFunctions

📒Interfaces

EmptyGhostProps

参数类型说明默认值
is?: string
style?: Omit<React.CSSProperties, "display">自定义样式,禁止覆盖 `display` 属性,因为组件内部强制使用 `display: contents`

🎗️Functions

EmptyGhost

  • EmptyGhost(props:EmptyGhostProps & React.RefAttributes<null | Element | Text>): React.ReactNode

Keywords

empty-ghost

FAQs

Package last updated on 11 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts