is-string-functional-component
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Usage

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.

Package 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

Last publish

Collaborators

  • lorenzobloedow