Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

can we use setstate inside build

Replace your setState() calls with setStateIfMounted() and define it as:

void setStateIfMounted(f) {
  if (mounted) setState(f);
}
 
PREVIOUS NEXT
Tagged: #setstate #build
ADD COMMENT
Topic
Name
6+7 =