You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.
Hello, I am very new to React Native and am trying to figure out how to fetch stock data from Alphavantage via axios. 1) Is axios the right way to go? 2) can u pls check my code and let me know where did I make an error? thank you
import React, { useEffect } from 'react';
import axios from 'axios';
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I am very new to React Native and am trying to figure out how to fetch stock data from Alphavantage via axios. 1) Is axios the right way to go? 2) can u pls check my code and let me know where did I make an error? thank you
import React, { useEffect } from 'react';
import axios from 'axios';
const axiosInstance = axios.create({
baseURL: 'https://www.alphavantage.co/query'
});
const App = () => {
useEffect(() => {
const fetchStockData = async () => {
const result = await {
return axiosInstance.get('', {
params: {
function: 'TIME_SERIES_DAILY',
symbol,
apikey: 'MV1565Q005IR7HDS'
}
})
};
}, []);
return (
<div style={ { display: 'flex', justifyContent: 'center' }}>
<div style={{width:'70%'}}>
);
};
export default App;
Beta Was this translation helpful? Give feedback.
All reactions