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

@easytool/react-types

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@easytool/react-types

This package use to check React element type.

latest
Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

@easytool/react-types

This package use to check React element type.

Install

npm install @easytool/react-types

Usage

import {
    isDOMElement,
    isComponentElement,
    isClass,
    isFragment,
    isPortal,
    isText,
    isEmpty
} from '@easytool/react-types';

isDOMElement(<p>Hellow World</p>);     // true

function MyComponent() {
    return (
        <p>Hellow World</p>
    );
}
isComponentElement(MyComponent);       // true

class MyClass extends Component {
    ...
}
isClass(MyClass);                     // true

isFragment(<></>);                    // true
isFragment(<React.Fragment></React.Fragment>); // true

var portal = ReactDOM.createPortal(
    [...],
    document.getElementById('app');
);
isPortal(portal);                          // true

isText(string | number);                   // true

isEmpty(null | undefined | true | false)   // true

API

export function isDOMElement(object);

export function isComponentElement(object);

export function isClass(object);

export function isText(object);

export function isEmpty(object);
/**
 * extends react-is lib below
 */
export function isFragment(object);

export function isPortal(object);

export function isElement(object);

export function isConcurrentMode(object);

export function isContextConsumer(object);

export function isContextProvider(object);

export function isForwardRef(object);

export function isLazy(object);

export function isMemo(object);

export function isPortal(object);

export function isProfiler(object);

export function isStrictMode(object);

export function isSuspense(object);

Keywords

react

FAQs

Package last updated on 06 Nov 2019

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