Hasnain Ali
Hasnain Ali

Reputation: 103

How to make vscode autocomplete props that are spread in a React functional component

I have a functional component in react native. It goes like this:

export const Row = ({ children, style, ...props }) => (
  <View
    style={[{ flexDirection: "row", alignItems: "center" }, style]}
    {...props}
  >
    {children}
  </View>
);

I am using it like this:

const App = () => {
  return (
    <Row>
      <Text>Hello</Text>
    </Row>
  );
};

export default App;

How can I enable autocomplete of vscode while using Row component. For example, I want to use onMagicTap that is in View, how can see the autocomplete in Row. I have spread the props in View but I can't see the autocomplete. Any solution to this?

PS. I am use JS, not TS

Upvotes: 2

Views: 1065

Answers (1)

mainak
mainak

Reputation: 2301

you can try vs-code extensions, one I use "React Native Snippet"

Upvotes: 1

Related Questions