{"name":"react-is","version":"18.0.0-alpha-6bbe7c344","keywords":["react"],"license":"MIT","_id":"react-is@18.0.0-alpha-6bbe7c344","maintainers":[{"name":"sebmarkbage","email":"sebastian@calyptus.eu"},{"name":"gaearon","email":"dan.abramov@gmail.com"},{"name":"acdlite","email":"npm@andrewclark.io"},{"name":"brianvaughn","email":"briandavidvaughn@gmail.com"},{"name":"fb","email":"opensource+npm@fb.com"},{"name":"trueadm","email":"dg@domgan.com"},{"name":"sophiebits","email":"npm@sophiebits.com"},{"name":"lunaruan","email":"lunaris.ruan@gmail.com"}],"homepage":"https://reactjs.org/","bugs":{"url":"https://github.com/facebook/react/issues"},"dist":{"shasum":"0ac60a1a16f9ff7cfec56a75c4d77218911a52ae","tarball":"http://registry-npm.ywwl.com/react-is/download/react-is-18.0.0-alpha-6bbe7c344.tgz","fileCount":8,"integrity":"sha512-e7C++9XVnwCKO0mrWH8Nk9SOonT9tlioMtbRFdgikTKA6If+j/rXTSDlAwyC65bK0yu+tfjauzKC/esN2ZmFYw==","signatures":[{"sig":"MEYCIQCbdX09ZZNqjMu93PuUJD5EKjOoBPUeCt+Ny7iMImWNrwIhAKNfF/LFW/a2BXMIkgDqjFcGYlYs+cQ8vQ52ZOgW6WPJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv5DFCRA9TVsSAnZWagAAFsoP/R6DD8iEpM3bsp5AsGwn\nJkxX67n78uzUr/TDvds5yjyc1lnYfuqDtzUCeTM4s1tocb8Fxocd45Gks1Y0\ncP5vMCqqSXo0kESISUJz4R91xwFN6yIKlNdOVTZsFlzLkeSYLLvYhQTrOLhP\nCbwT1KBUNHuhJekWkrfZN/TLFi6ECR9oC5xjk/jHV5ejdf4JRTodr4HvcwED\n1KJ+kjy/tHt/+Fh4VctxlsYwqaVJStI9TbbhlKvoesyv3syKzfwA5vjnq1cH\nDzKVe40MrZlcaNDLzHnsBPQ9dqf8aVr1p12JwgTzrzaBdIyFL3PZBS94JAfR\nE1j9DPFhPf+QhImbWmezRztZuIFyyg7niRlnVml+iKjsSB0Z6ZFLL9hI9u+o\negTl68zdx2/fk5IDhJqONrZx8mGs+04RggnKRSziAjoWolYNNEs5te1X5Muq\nj44LV14FsPLbz5i+lewkuoUa/xyDJEhxLIUGvJ4ql4J64OyF/fXhqgWs4gkz\nLsXv8DMvTanLTdVPqcMRQ5u/6soP/N6EmaNf/4fq9zimmqMgojBpOYNX0g5g\n19c1D9G5+zE+nanTUKIRVRZ+hDQqOeBgLn3br7ZX7fIZNaKOIUZs2zIB4Zlz\nV57U9qhDA/V1jmA9b5dQtFxDnrkG36zUHRCGcwKqgj0SdcUQCcNxovfmZY0m\nQWVp\r\n=KEZM\r\n-----END PGP SIGNATURE-----\r\n","size":5894,"noattachment":false,"key":"/react-is/-/react-is-18.0.0-alpha-6bbe7c344.tgz"},"main":"index.js","readme":"# `react-is`\n\nThis package allows you to test arbitrary values and see if they're a particular React element type.\n\n## Installation\n\n```sh\n# Yarn\nyarn add react-is\n\n# NPM\nnpm install react-is\n```\n\n## Usage\n\n### Determining if a Component is Valid\n\n```js\nimport React from \"react\";\nimport * as ReactIs from \"react-is\";\n\nclass ClassComponent extends React.Component {\n  render() {\n    return React.createElement(\"div\");\n  }\n}\n\nconst FunctionComponent = () => React.createElement(\"div\");\n\nconst ForwardRefComponent = React.forwardRef((props, ref) =>\n  React.createElement(Component, { forwardedRef: ref, ...props })\n);\n\nconst Context = React.createContext(false);\n\nReactIs.isValidElementType(\"div\"); // true\nReactIs.isValidElementType(ClassComponent); // true\nReactIs.isValidElementType(FunctionComponent); // true\nReactIs.isValidElementType(ForwardRefComponent); // true\nReactIs.isValidElementType(Context.Provider); // true\nReactIs.isValidElementType(Context.Consumer); // true\nReactIs.isValidElementType(React.createFactory(\"div\")); // true\n```\n\n### Determining an Element's Type\n\n#### Context\n\n```js\nimport React from \"react\";\nimport * as ReactIs from 'react-is';\n\nconst ThemeContext = React.createContext(\"blue\");\n\nReactIs.isContextConsumer(<ThemeContext.Consumer />); // true\nReactIs.isContextProvider(<ThemeContext.Provider />); // true\nReactIs.typeOf(<ThemeContext.Provider />) === ReactIs.ContextProvider; // true\nReactIs.typeOf(<ThemeContext.Consumer />) === ReactIs.ContextConsumer; // true\n```\n\n#### Element\n\n```js\nimport React from \"react\";\nimport * as ReactIs from 'react-is';\n\nReactIs.isElement(<div />); // true\nReactIs.typeOf(<div />) === ReactIs.Element; // true\n```\n\n#### Fragment\n\n```js\nimport React from \"react\";\nimport * as ReactIs from 'react-is';\n\nReactIs.isFragment(<></>); // true\nReactIs.typeOf(<></>) === ReactIs.Fragment; // true\n```\n\n#### Portal\n\n```js\nimport React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport * as ReactIs from 'react-is';\n\nconst div = document.createElement(\"div\");\nconst portal = ReactDOM.createPortal(<div />, div);\n\nReactIs.isPortal(portal); // true\nReactIs.typeOf(portal) === ReactIs.Portal; // true\n```\n\n#### StrictMode\n\n```js\nimport React from \"react\";\nimport * as ReactIs from 'react-is';\n\nReactIs.isStrictMode(<React.StrictMode />); // true\nReactIs.typeOf(<React.StrictMode />) === ReactIs.StrictMode; // true\n```\n","_npmUser":{"name":"acdlite","email":"npm@andrewclark.io"},"repository":{"url":"git+https://github.com/facebook/react.git","type":"git","directory":"packages/react-is"},"_npmVersion":"6.14.8","description":"Brand checking of React Elements.","directories":{},"_nodeVersion":"12.19.0","_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/react-is_18.0.0-alpha-6bbe7c344_1623167172867_0.10245288108075301","host":"s3://npm-registry-packages"},"publish_time":1623167173055,"_cnpm_publish_time":1623167173055,"dist-tags":{"backport":"19.1.10","beta":"19.0.0-beta-26f2496093-20240514","canary":"19.3.0-canary-edae846a-20261125","experimental":"0.0.0-experimental-edae846a-20261125","latest":"19.3.1","next":"19.3.0-canary-d5736f09-20260507","rc":"19.0.0-rc.1"}}