Closed cptiwari20 closed 4 years ago
` await MySwal.fire({ title:
{inte.toUpperCase()}
const token = JSON.parse(localStorage.getItem("login")); async function handleFormSubmit(){ if (token) { const id = Auth.decode("id"); const url = `${process.env.REACT_APP_ADMIN_SERVER_URL}/integrations/`; await axios .post(url, data, { headers: { authorization: token.token }, }) .then(async data => { // console.log(data) setIntegrations(data.data); }).catch(e => { MySwal.showValidationMessage( `Request failed: ${e.message}` ) }); } } handleFormSubmit() }, }).then(({isConfirmed}) => { if(isConfirmed){ //do something } }) }
`
data = { ...stateObj, type: 'xyz' } When I submit the form, I get the stateObj Value == undefined. Its seems wired that, I think sweetAlert popup doesn't get any extra value from the state after fired once. If it is so, how can I get the state.
data = { ...stateObj, type: 'xyz' }
https://stackoverflow.com/questions/ask
` await MySwal.fire({ title:
{inte.toUpperCase()}
, // footer: 'Copyright 2018', html:`
data = { ...stateObj, type: 'xyz' }
When I submit the form, I get the stateObj Value == undefined. Its seems wired that, I think sweetAlert popup doesn't get any extra value from the state after fired once. If it is so, how can I get the state.