I have a functional component like above (only js). After building the library and publishing, I import into my project but vscode doesn't suggest to me which props I need to use.
Below is my setting:
You might want to check React TypeScript.
React JavaScript won't tell you any required props, and using TypeScript will help you achieve that.
type Data = {
id: string;
name: string;
email: string;
address: string;
}
type Props = {
sortable?: boolean;
data: Data[];
filters?: any;
}
function CommonTable(props: Props) {
// code
}