skip to Main Content

When i create new fresh Next.js app and use JavaScript and open it using vs code, in .jsx files, suggestions not working as shown in the image, the props suggestions of any component not showing.
Suggestions not working
Props Suggestions not working
But when i create it and use TypeScript it works.

I deleted all settings.json file and reset all vs code settings but i doesn’t work.

2

Answers


  1. I will suggest you to follow these methods

    • Check for VS Code Updates
    • Clear VS Code Cache
    • install required extensions
    Login or Signup to reply.
  2. Some possible solutions to your issue with VS Code not suggesting JSX attributes:

    1. Change the file extension: Instead of .js or .ts, try using .jsx or .tsx. This can often help with JSX suggestions.
    2. Import React: Even though it’s not required in recent versions of React, importing React (import React from 'react';) in your file can sometimes make VS Code recognize and suggest JSX again.
    3. Check the language mode: Make sure that the "select language mode" tab on the bottom right of the VS Code window shows "Javascript React". If it doesn’t, you can change the language mode from the command palette (Ctrl+P) or from the bottom panel.
    4. Install and enable the ES7 React/Redux/GraphQL/React-Native extension: This extension can provide improved JSX suggestions.
    5. Add a jsconfig.json file and install @types/react: This can help with JSX suggestions.

    If the problem persists, there might be other factors at play, such as other extensions interfering with VS Code’s IntelliSense.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search