I have a class component where after updating state,I am calling a function immediately as a callback func in setState.
Code
this.setState(
{
selectedOption: resp?.vatTaxName,
isUpdateVatTax: !!resp?.vatTaxName,
vatTaxRate: resp?.vatTaxRate,
vatTaxName: resp?.vatTaxName,
vatTaxId: resp?.vatTaxId,
},
() => this.checkVatEnabled(this.state.selectedOption),
)
I want to use the same code in functional component,How I can achieve this?