Skip to content

reactSnippets.settings.importReactOnTop not working #244

Open
@DavidArmendariz

Description

@DavidArmendariz

This configuration is not working. When I set this in my settings.json:

reactSnippets.settings.importReactOnTop

And then try to use any snippet, it is still importing React on the top.

Activity

ice-chillios

ice-chillios commented on Feb 27, 2022

@ice-chillios
Member

@DavidArmendariz please provide full settings.json related to reactSnippets and some repro as on my end works fine.

DavidArmendariz

DavidArmendariz commented on Feb 28, 2022

@DavidArmendariz
Author

@dsznajder I don't have any other configurations related to reactSnippets. I only have this in my settings.json:

"reactSnippets.settings.importReactOnTop": false,

The repro would be to type some command like rafce. It would give me something like this:

import React from 'react'

const index = () => {
  return (
    <div>index</div>
  )
}

export default index
ice-chillios

ice-chillios commented on Feb 28, 2022

@ice-chillios
Member

Did you reload vscode after changing this settings as extension said?

DavidArmendariz

DavidArmendariz commented on Feb 28, 2022

@DavidArmendariz
Author

@dsznajder Yes!

saulloalmeida

saulloalmeida commented on Mar 22, 2022

@saulloalmeida

i'm having the same issue with reactSnippets.settings.importReactOnTop setting. Even setting it to false it still keeps showing up with the rfce snippet.

opes

opes commented on Apr 6, 2022

@opes

I had this same issue recently start happening. I resolved it by toggling the setting on & off again, then invoking Developer: Reload Window.

notkiran

notkiran commented on Apr 11, 2022

@notkiran

same issue, my setting snd settings.json has -
"reactSnippets.settings.importReactOnTop": false,
but still rafce is importing the react at top. please fix it.
have restarted and reloaded the VS CODE

dougbeckwith

dougbeckwith commented on Apr 15, 2022

@dougbeckwith

I'm also having the same issue with ImportReactOnTop setting not working

settings.json is set to this
"reactSnippets.settings.importReactOnTop": false,

When i use the rafce snippet it generates

import React from 'react'

const App = () => {
  return (
    <div>App</div>
  )
}

export default App

please fix thanks :)

bradenmitchell

bradenmitchell commented on Apr 29, 2022

@bradenmitchell

I am also experiencing this issue. I have done the following steps and it still places the import statement at the top:

  1. Set "reactSnippets.settings.importReactOnTop": true
  2. Reloaded window
  3. Ran rfc confirm import statement is present
  4. Set "reactSnippets.settings.importReactOnTop": false
  5. Reloaded window
  6. Ran rfc confirm import statement is still present (should not be present)
Jolsty

Jolsty commented on Nov 14, 2022

@Jolsty

I am also having this issue. I am running the latest version (4.4.3) with the setting on false and it still imports React when i use the snippets

csfx-py

csfx-py commented on Nov 20, 2022

@csfx-py

have the same issue, any updates on this?

push-on

push-on commented on Dec 28, 2022

@push-on

disabling and enabling it fixed for me.
but this solution is not permanent

Jolsty

Jolsty commented on Dec 30, 2022

@Jolsty

I found that disabling this experimental setting made it work properly again!

image

2 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      reactSnippets.settings.importReactOnTop not working · Issue #244 · r5n-labs/vscode-react-javascript-snippets