Questions tagged [setstate]
Use for questions relating to the [setstate] method and component/widget state management in [reactjs] and [flutter].
setstate
2,651
questions
0
votes
0
answers
35
views
flutter: my custom-paint not updating until I pan the canvas or move something outside the stack
I've been facing a problem with my mind map app, it is more like a node editor, when I move/drag the nodes it updates instantly, but when I try to drag from the node output to create a connection, the ...
0
votes
0
answers
16
views
How can I change contents of DataTable with setState
I have a problem. I am beginner for Flutter. I am making a share app and when I add a new share, it doesn't appear on DataTable. Here is my main page and share adding page code;
MainPage
class MyApp ...
0
votes
0
answers
25
views
How to change a baseUrl in a widget using a toggle switch?
Very new flutter user here. I am using the flutter_map and the toggle_switch packages. I want the toggle switch to change the base map when selected, but I'm really lost on how to set it up.
My ...
-1
votes
1
answer
35
views
setState not triggering a re-render when data has been modified(state type is variable)
I changed a state with setState, but it did not trigger a re-render. I considered it a minor issue, so I searched extensively, but I couldn't find a solution.
I want to check the second and third ...
0
votes
0
answers
27
views
How can I call a setter function inside of setState
I have the following class:
export default class Global {
public config!: Config;
public components!: Component[];
constructor(config: Config) {
if (!config) {
throw new Error("...
0
votes
0
answers
33
views
Flutter UI Screen doesn't update
I am new to Flutter and need some help. I am working on an App to choose between Eating Plans. In the setting screen I want the user to be able to make some changes on the plans. You can klick on a ...
0
votes
1
answer
29
views
async setState in react not effect
I have a app.jsx, which will request two different api named API_A & API_B. I will get data_A and data_B from this two api and merge them into a info state for render ui. My code is like this:
...
0
votes
1
answer
33
views
'onTap' isn't working, After fixing the "setState() or markNeedsBuild() called during build." error
I am building the BMI calculator app,
after all, it giving me "setState() or markNeedsBuild() called during build." error.
so, i come up with below solution..
onTap: () {
...
2
votes
3
answers
68
views
ReactSearchAutocomplete - set state not updating items, only updates on next search
I'm using ReactSearchAutocomplete to display a list of 10 suggested names from a mySql query. The query is performed with a 100ms delay on user input, and it works fine but I'm clearly not handling ...
1
vote
1
answer
53
views
Is it possible to update state within a useReducer
So here's my issue, im currently learning about the useReducer function and trying to utilize it to create a react based quiz, selection screen. I wanted to update the state (so it could be uplifted ...
1
vote
1
answer
51
views
Wrapping setState in NavLink callback gives bad setState warning
I have a Tabs component that has bunch of NavLinks. I'm trying to show a loading spinner based on the NavLink's isPending property on the parent component. So I'm showing spinner when there is a ...
0
votes
2
answers
44
views
How can I rebuild a widget after the StreamBuilder gets built?
I'm trying to get the totalValue in the title of the appBar. The value of totalValue comes from the Streambuilder and it changes everytime I press the FilterChips.
Code:
import 'package:flutter/...
0
votes
1
answer
32
views
React setState from fetch and send it to another fetch
I have a function that calls 2 functions, one uploads an image and stores it in some directory, and the other send product related data to edit/store in the database:
const uploadImage = async () =&...
0
votes
1
answer
34
views
Disabling Flutter ElevatedButton is not fast enough
I have followed the examples on disabling the flutter elevatedbutton after first press, but its not fast enough. Part of my onPressed makes a call to a backend server for data, but its somewhat of a ...
0
votes
0
answers
48
views
React-Infinite-Scroll-Component re-render error (Maximum update depth exceeded)
Good day. I am implementing a list page that will involve infinite scroll. I am getting my data from a Laravel API and I am fetching the data with react query. This page also has a search ...