I have a URL which should be changing dynamically. The number 2 is dynamic.
const API_Albums = `https://jsonplaceholder.typicode.com/users/2/albums`
class Main extends Component {
...
fetchAlbums(id) {
axios.get(API_Albums+id/albums)
.then(result => {
.....
})
.catch(error => console.log(error)
)
}
}
How can I change only the id's part of URL?