I want to add loading message for export file button if it takes time to load for example first message "please wait" after 10 seconds settimeout to "loading..." after 20secound "sorry, please wait"
const [loading, setLoading] = useState(false);
function greet1() {
return "please wait.."
}
function greet2() {
return "loading"
}
function greet3() {
return "sorry, please wait..."
}
const list= () => {
setLoading(true)
if (loading) {
setTimeout(() => {
greet1
}, 0);
setTimeout(() => {
greet2
}, 2000);
setTimeout(() => {
greet3
}, 3000);
}
}