r5n-dev / vscode-react-javascript-snippets

Extension for React/Javascript snippets with search supporting ES7+ and babel features
MIT License
1.71k stars 440 forks source link

Use interface instead of type for props and state [TypeScript] #235

Closed max-programming closed 2 years ago

max-programming commented 2 years ago

This PR changes the use of type keyword to interface. Because interfaces are specifically made for objects. And props and state (in class components) are objects.

It does not make any difference. But as interface is used for objects only, it's better to use that instead of type.

// BEFORE
type Props = {};
// AFER
interface Props {};
chillios-dev commented 2 years ago

@max-programming It won't change (as it's dynamically generated anyway) and it's a very opinionated thing. There is setting to change it dynamically so you can check it out and use it.

max-programming commented 2 years ago

Gotcha! Thanks @dsznajder