Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- constructor() {
- super();
- this.state = {
- sds: []
- }
- }
- componentDidMount() {
- axios.get('/userData', {
- params: {
- user: this.props.auth.user.name
- }
- }).then(res => {
- for(var i=0; i<res.data[0].chemID.split(',').length; i++){
- if(res.data[0].chemID.split(',')[i] != 0){
- axios.get('/chemData', {
- params: {
- id: res.data[0].chemID.split(',')[i]
- }
- //This is where I want to insert the data
- }).then(res => this.sds += ({
- id: i,
- title: res.data[0].chemName,
- selected: false,
- key: 'sds'
- }))
- }
- }
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement