import isStringFunctionalComponent from "is-string-functional-component"
const functionalComponent =
`function ExampleComponent() {
return <h1>This is an example!</h1>
}`
isStringFunctionalComponent(functionalComponent) // Returns true.
const randomString = "foo";
isStringFunctionalComponent(randomString) // Returns false.
const classComponent =
`class Test extends React.component {
render(<h1>Testing</h1>);
}`
isStringFunctionalComponent(classComponent) // Returns false.
is-string-functional-component![This package contains built-in TypeScript declarations TypeScript icon, indicating that this package has built-in type declarations](https://static-production.npmjs.com/255a118f56f5346b97e56325a1217a16.svg)
1.0.3 • Public • Published Package Sidebar
Install
npm i is-string-functional-component
Weekly Downloads
0
Version
1.0.3
License
GPL-3.0
Unpacked Size
38.7 kB
Total Files
6