I have VS Code and use it to edit my ReactJS application, along with several other people. I have the React Snippets extension installed but nothing else. It seems VS Code is reformatting my code, however, so that whenever I commit something with a small change, there are 20,000 diffs to review because of whitespace changes. Does anyone know why this is happening and how to stop it?
Related
I have noticed something about react recently. There are 3 react projects that I am working on. Everything is going well, but the problem is, I can't update new files that I just created in the project.
I am using Sanity.io in one of them and I have been trying to save the new components I just created but it's not working.
Initially I thought it had something to do with my codes, but I was surprised to experience it again in a MERN stack project I am working on. I can't save any new file I create.
Now there's another project I'm working on using Redux toolkit, I'm also experience the same issue.
I am using VS Code and I have reloaded the editor several times and its still not working.
At this point I assumed it was a VS code settings issue, so I switched one of the projects to Atom, and still the same thing.
What could be the cause of this? Is there a new feature or update in react that I don't know of? Or is it a file structure issue? I'm new to React so I don't know much.
Note, I didn't add codes to this question since I feel it much to do with my know of React in general than my codes.
I will appreciate every assistance I can get.
This is very simple component I built throughout the course I take (Recently I've started learning React). This "error" only occures when I add a dollar sign inside a <div></div> in combination with {}. Since the code runs without any errors in the Node.js environment, why is my IDE behaving that strangely? I think there might be something wrong with the settings, but it's only my assumption. Have someone had this issue before or maybe know how to solve it? It's kinda frustrating for me, especially when I'm just learning the framework and the IDE shows mistakes in the places where there are no mistakes.
I just found a solution. It was Bracket Pair Colorizer 2 extension. After disabling it the problem is gone.
I'm trying to debug my gatsbyjs code in visual studio code. I followed the docs and and tried slightly different approaches like https://github.com/Microsoft/vscode-recipes/tree/master/Gatsby-js.
I can start debugging and the site builds, but my none of my breakpoints in any of my files get hit, they get instead show up as unverified.
When pausing the debug process though, I (somewhat) randomly end up in the source code of any of the external modules, and there I am able to place breakpoints that do stop...
Is there maybe some setup step or something I'm missing to make it work on page components and other react components?
Thanks for any help!
Adding a
debugger;
statement in the JS react page components definitely works for me. But be reminded that in development mode (gatsby develop), some breakpoints will get hit on startup, while others are only hit on page request. This of course depends on where you place your breakpoints.
I have a simple react project (npm, babel, es6). I would like to set language for WHOLE project. Not only for one file (what works). I checked a lot solution (ex. https://github.com/moment/moment/issues/1875#issuecomment-263220119) and it still doesn't work.
Does someone know how to solve this problem?
This is a really strange issue that I've been trying to figure out for several days with no luck. It only happens on slow iOS devices, it doesn't happen every time, and it only happens when using minified JS code (both Angular and my app code).
When the issue occurs it looks as though Angular just stops processing the code and leaves the "mustaches" on the page as can be seen in the attached screen shot. If I switch to using the non-minified versions of my JS files as well as the non-minified angular files then it works just fine. I've used Safari developer tools to debug this issue, but there are no exceptions thrown and it looks like all the data is being set correctly on the scope.
Any help/ideas with this issue will be greatly appreciated.