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
1.0.3 • Public • PublishedPackage Sidebar
Install
npm i is-string-functional-component
Weekly Downloads
1
Version
1.0.3
License
GPL-3.0
Unpacked Size
38.7 kB
Total Files
6