{"name":"react-is","version":"0.0.0-experimental-5de5b6150","keywords":["react"],"license":"MIT","_id":"react-is@0.0.0-experimental-5de5b6150","maintainers":[{"name":"acdlite","email":"npm@andrewclark.io"},{"name":"brianvaughn","email":"briandavidvaughn@gmail.com"},{"name":"fb","email":"opensource+npm@fb.com"},{"name":"gaearon","email":"dan.abramov@gmail.com"},{"name":"lunaruan","email":"lunaris.ruan@gmail.com"},{"name":"sebmarkbage","email":"sebastian@calyptus.eu"},{"name":"sophiebits","email":"npm@sophiebits.com"},{"name":"threepointone","email":"threepointone@gmail.com"},{"name":"trueadm","email":"dg@domgan.com"}],"homepage":"https://reactjs.org/","bugs":{"url":"https://github.com/facebook/react/issues"},"dist":{"shasum":"d03fdb7574c90681693293626ed2e8e7c3f48794","tarball":"http://registry-npm.ywwl.com/react-is/download/react-is-0.0.0-experimental-5de5b6150.tgz","fileCount":9,"integrity":"sha512-RIBgyAv2tgtdSXqLTLU43ghgG0mHmoY1chFAZksh8v1Y5Y8yuW3NL7ePjcxtQYmaWRT+8AcR0Ve6KnRoFNiJYw==","signatures":[{"sig":"MEUCIGmMzfTFsy09ytRF85ID4u2inphvL1Lhp9hgzZo39BYkAiEAsHqYlDu+Tak1yiDyseiGaMF/iHq59voLo6GHevovUUo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTyTyCRA9TVsSAnZWagAANRAP/1bH9hDSzkZ8VOm6rdbO\ndgLDwKG58olSqP7+hH9D8aWhleRKb+MHN6YRKOWHV4Ve8JFsI4h5nkQN56NN\n39BocPb9mG1zF9TTwTCE454BdauyN+jx2Nt3IowoFQYoDr3pC05u+dgvJSoM\n1xRw8VUPkMGGruRwEA5AM0qC1v68iyOwteHs2hYkuWQoZsw5OYpAFe0t6yly\nfwSDLrCo47kUjCnzOc9VU3wI6sP/sLynvj+xZHp0cmw/anLzL2el+Is+vdH1\nG+n1DDcUHRNtJcN/ZqdSgS8FTKRVnIrPPIHPohLP+QMeewamf+/BJLaQr1er\nDyw4WmRSBzD+4sNJ4aa2+VSP413J4LxLVccpzijYofpyKu/3iI9mIiVS2/wy\n96Z6fXWT97T0kH/cjA1Kxzk+0dEHoX0jlEqmUD26pbQL5/9qhP1gA6ls5uZA\nGN1SRm1NUruKoe1xLMDe5G6vdezlDrzpLe97TLKt3Og4WLnzfJqeRv1qxoZN\nEdFWVxukB/MhUh468CKb+SK3BzFEAx4jGBA0lNSxbXTg0SFN4G4p7Euyyss2\nWcDVIENKosP2/PZQb597+7GK4kmMIgr/s9luqb4nlfLKWUz4ZI7trTpOjYas\nSvBUXvLGaUPzfvcg6m9RaT9b571LrCfgNWoC1Y6oXVDSmSDVaszaP8ohZczl\ngTTf\r\n=B8dy\r\n-----END PGP SIGNATURE-----\r\n","size":5544,"noattachment":false,"key":"/react-is/-/react-is-0.0.0-experimental-5de5b6150.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.4.1","description":"Brand checking of React Elements.","directories":{},"_nodeVersion":"10.14.2","_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/react-is_0.0.0-experimental-5de5b6150_1582245106452_0.23408267684250972","host":"s3://npm-registry-packages"},"publish_time":1582245106628,"_cnpm_publish_time":1582245106628,"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"}}