How to make VS Code autocomplete React component's prop types while using the component in JSX markup?
P.S.: I'm using JS, not TS.
How to make VS Code autocomplete React component's prop types while using the component in JSX markup?
P.S.: I'm using JS, not TS.
You can also get intellisense support from PropTypes. You'll need to install prop-types
import React from "react"
import PropTypes from 'prop-types';
function Header(props) {
return <h1>{props.headerText}</h1>
}
Header.propTypes = {
headerText: PropTypes.string.isRequired
}
export default Header