0
votes

enter image description here

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:

enter image description here

enter image description here

vscode doesn't suggest me which props i need to use

1

1 Answers

0
votes

You might want to check React TypeScript.

React JavaScript won't tell you any required props, and using TypeScript will help you achieve that.

Example:

type Data = {
  id: string;
  name: string;
  email: string;
  address: string;
}

type Props = {
  sortable?: boolean;
  data: Data[];
  filters?: any;
}

function CommonTable(props: Props) {
  // code
}

enter image description here