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

React 17 no longer needs React to be in scope #237

Closed kylelamse closed 2 years ago

kylelamse commented 2 years ago

With the release of React 17, is there going to be support for snippets that exclude the import React from 'react'; statement from the top? There could possibly be an option to detect what version is in the project, and automatically disable adding this. As of now, my editor grays out the statement and displays a warning. image

chillios-dev commented 2 years ago

@kylelamse take a look at options. There is import React on Top checkbox. After extension initialisation (i.e. open javascript/typescript file). Go to your settings, uncheck it and restart VSCode. Those snippets should't have this import from now on.