Axios plugin creates wrong import statement

New to ReactStudio, seems to work great for what I need.

I’m using axios to interface to a REST API. Press a button, POST some data, etc. All works fine if I manually axios to the project directly via:

npm install axios

And I add this to the code:

import axios from “axios”

But I have to do the install every time the code is rebuilt, since the dev server code will install what it thinks is necessary, thus removing axios (else I get axios not found).

I believe the correct way to include axios in the project is to add it via the plug in manager as a wrapping NPM package component. But when I do that, I get the following import:

import Axios from ‘axios’

That’s Axios with a capital “A”, which, of course, does not work.

Didn’t see anything obvious in the forums. Can’t figure out what I’m doing wrong, any ideas are appreciated.


Hi, I it is not necessary.
Look at not visual plugin to understand how import axios in react studio project at design time.
You can use fetch to make rest requests and it is already in JavaScript… You with async or promise mode.

Thanks, yes, I could use fetch() but I’m porting over some legacy code and it would be easier right now to use axios.

Sorry I don’t understand what you mean by “look at not visual plugin”. Can you provide a reference or link?

Whether I use fetch or axios, I like ReactStudio, and this will help me understand how to use it better.