Questions tagged [state]

The contents of memory locations, at any given point in the program's execution, is called the program's state.

state
Filter by
Sorted by
Tagged with
1 vote
2 answers
10k views

openstack instance task_state stuck in powering off, how reset it to None

An instance execute shutdown in operation system, and the power_state is Shutdown, but the vm_state is active without shutdown the instance through API, and Why the task_state is always powering-off, ...
0 votes
0 answers
73 views

Is it possible with Next.js 14 to update the app state in the browser from the server in real-time without the use of WebSocket?

Is it possible with Next.js 14 to update the app state in the browser from the server in real-time without the use of WebSocket? The late versions of Next.js have got more capabilities to mix and ...
0 votes
0 answers
22 views

Input fields and dropzone taking previous state values on api call for file stream in React

I am having two pages one is Update user and second is User profile, the Updae user edits the user in userlist while the User profile edit the current logged in User, The problem I am encountering is ...
0 votes
1 answer
153 views

How do I preserve state when hot reloading in a standard SvelteKit dev environment?

I have a pretty standard out of the box Svelte dev environment setup based on these docs in early 2024. My vite.config.js file currently looks like this: import { sveltekit } from '@sveltejs/kit/vite';...
20 votes
4 answers
26k views

How to resolve emit was called after an event handler completed normally bloc error?

I am using flutter bloc to make download progress percentage displayed but I keep getting this problem. I figured the problem arises in the onDone method but I couldn't figure out how to fix it. ERROR ...
1 vote
2 answers
980 views

Why is my list not being updated in Jetpack Compose?

I have a ViewModel which contains a StateFlow which is being collected on the main screen. The first method I use in my viewModel is to get it to check if there are elements in the database and if not,...
0 votes
0 answers
31 views

List data was processed as a GenericType in Flink

I am new flink and want to process List as Tuple like Tuple8<String, String, String, String List<String>,List<String>,List<String>,List<String>>. But when I submit my job ...
1 vote
1 answer
1k views

Framer-Motion, toggle between 2 different enter and Exit states

I'm trying to animate some elements based on weather the user is progressing forward or backward. e.g. state > prevState or state < prevState Here is what the logic looks like. -Hook to update ...
0 votes
0 answers
5 views

Visualize Bhutan Map with District names and population count of each district using R

This is the code that I used for visualize Bhutan map. I used "rnaturalearth" package in R. Now I want to Vizualize Each district population count on the map. bhutan_states <- ne_states(...
0 votes
1 answer
52 views

How can I get my React component to trigger a fetch when another component is used?

I have a React project. Initially I was fetching the data I want to display on a component straight from the directory and that was working well. I have now added an endpoint that returns the data and ...
80 votes
11 answers
36k views

Does C++ support compile-time counters?

For the purpose of introspection, sometimes I've wanted to automatically assign serial numbers to types, or something similar. Unfortunately, template metaprogramming is essentially a functional ...
2 votes
1 answer
123 views

Flutter Bloc copyWith Function not working

I am using Flutter Bloc with event and states. I have tried multiple things but the copyWith functions is not working at all. The bloc just yields now state every time and reset's the previous one. ...
2 votes
2 answers
134 views

State update is causing Next.js to soft refresh the page

I have a modal component in my Next.js project using Radix UI. There are different two way binded inputs using state. The problem is when the state is update the entire page re-renders causing all ...
0 votes
1 answer
94 views

How to design a Rust struct with a callback to modify its state/fields [closed]

I'm using a library that provides me with structs and methods necessary to create an object and assign a custom callback to its event. But with each callback I need to keep track of a global or object ...
2 votes
1 answer
35 views

Flutter - Can't refresh data after Navigator.push with firestore

I'm trying to make a favorites widget that will display items that have been added as "favorites" for the current user. So lets say I click on a favorite item called "Pizza", it ...
4 votes
1 answer
9k views

Failed to execute 'setItem' on 'Storage': Setting the value of 'state' exceeded the quota (localStorage.clear() won't work)

In my React project I use Redux where I save the serialized state: const saveState = (state: any) => { try { const serializedState = JSON.stringify(state); localStorage....
1 vote
1 answer
122 views

Is it okay to use both Bloc and Provider in the same project?

Let's assume that I have some data stored in a database and that I wanna fetch that data when launching my app. I also want that data to be accessible from anywhere on my app because my blocs will ...
-1 votes
1 answer
44 views

Updating a View in a loop

I am trying to create some feedback when iterating through a directory. I find that the text field doesn’t update until right at the end. Here is a test script which has the same problem: struct ...
0 votes
3 answers
859 views

SetState() does not change my state in a PopupMenuButton

My screen bears a popup menu where the user can pass in expert mode by taping on a button (see the screen shot below). But, though the setState() is being executed, the redraw always resets ...
3 votes
4 answers
9k views

Get the billing state code to display the name in WooCommerce

I am trying desperately to understand, how WooCommerce translates certain countries county/state names into database field constants and back. ie. I have a customer from Greece, who happens to be ...
0 votes
0 answers
187 views

reading data from localStorage does not render in react js

I have a MenuComponent.js component which brings me data from an API and draws the products through a map. import ProductCard from './Cards/ProductCard' import {Container, Row, Col, Button} from '...
0 votes
1 answer
29 views

useState isn't working when parent useState function is applied

I have a ticket child class that sets the total amount after no of tickets has been been changed the problem i am facing here is setNumber doesn't seem to work unless setTotal is commented out, i don'...
0 votes
2 answers
36 views

Re-rendering conditional buttons

This is for an interactive bible. In the following code I have buttons that are being conditionally rendered based upon the buttons I previously clicked. The code calls an API to retrieve the data. ...
0 votes
0 answers
10 views

Where is the best place to store user data on the web interface

I'm developing a full-featured Next.js application. This is my first experience creating authorization and I want to know where is the best way to store user information on the client. The site allows ...
0 votes
1 answer
20 views

React Route Protection Fail because of the state did not change

I am trying to implement a route protection feature calling a backend for authentication. backend response is ok, but the front end gives me a strange behaviour, I stucked for a week but didn't find ...
0 votes
0 answers
41 views

Widget not constantly rebuilding + State issues

In my audio player I'm currently facing an issue. So how I set up the controls for the song (pause/play, rewind, etc.) is that when you click on a button, a modal sheet pops up. In that modal sheet ...
0 votes
1 answer
365 views

componentWillReceiveProps render multiple times

I am getting datas from my database using three different functions, but as I've seen componentWillReceiveProps is rerendering for three times in this case, which cause duplicating my elements in the ...
0 votes
0 answers
25 views

How can I get the updated information from Firestore?

What I'm trying to obtain is a real-time updated value of a variabile stored in Firestore using the Provider package. Without putting the entire code inside here, i with get you a simple, but ...
0 votes
1 answer
68 views

SwiftUI Completion Logic in View onAppear

I am fairly new to SwiftUI. In this example I am running a network request through an API that has a completion handler in order to alter the app state, i.e., show a different view based on a tokens (...
-1 votes
2 answers
79 views

In SwiftUI, why is a @State variable silently ignored in init()?

Based on the order of the output in the xcode's console, it seems to suggest that default assignment happens before the execution of init(). However, the assignment in init() does not take effect. ...
0 votes
0 answers
58 views

What is the right approach to handle asynchronous task in compose (Android)

As I am making progress in learning compose and Android in general. I need some help regarding best approach to handle async task. lets say I have a button that call some methods of a view model //...
0 votes
1 answer
56 views

How do I pass my state from a child component to a parent component, then to another child component of a different parent component?

Currently working on a CV Creator as a mini React project, these are my current Components: Creator Form Input CvDisplay (DisplayComponents) I have a state in my Input component that updates upon ...
0 votes
0 answers
284 views

Component is re-rendering although value in zustand store do not change

I'm trying to implement Zustand into my app to avoid unnecessary re-rerendering and improve the performance of my app. For this I created a testStore: const useTestStore = create((set) => ({ ...
0 votes
0 answers
60 views

Restore pageView state when switching to another app page and back

I'm developing a social app with flutterflow. Is there a way to keep and restore the pageView state itself and its children when switching to another app page? My use case is a feed page based on ...
1 vote
1 answer
2k views

React+Redux. Connect doesn't update state of component

I have some problem with Redux. I created Reduser and it work fine. It change store and i can show that in ReduxDevTools. But in the component state doesn`t update. I have mapStateToProps, ...
1 vote
1 answer
181 views

Redux + Selector unknown returned the root state when called. This can lead to unnecessary rerenders. ... warning + where state is an array

I am using Redux 5 in my React 18 application. When using the useSelector() method from the react-redux package, I get the below warning in the browser console: Selector unknown returned the root ...
0 votes
1 answer
58 views

Prevent react native component from re-rendering on every state change

I have a component witch should either show A or B based on whether the user is nearby a certain location. I created a custom hook for retrieving the value of the user being nearby. My problem is that ...
0 votes
1 answer
74 views

laravel livewire if selected option is others add dynamic input

order.blade.php (step component) <div class="mt-2"> <x-input-label for="category" :value="__('Category')" /> <x-input-select wire:model.change=&...
1 vote
0 answers
27 views

Idea needed: How to make viewmodel state - drag&drop in compose list that can be edited

I have a very simple list on the screen. Data goes from viewmodel state from database as observable flow (very ordinary case) List item is very simple: it has id, name, order_ (the order of item in ...
1 vote
5 answers
1k views

Reactjs hooks setState - how to setState and wait for it to implement and console.log(newState)

how can I console.log(name) that will print the new state which is "Tom". is there a way I can wait for the setName() to finish updating the state and then print the new name? (It was also a ...
2 votes
1 answer
11k views

console.log this.state is not showing the current state in react

I'm new to react and toying with a sign-up form. My render method always displays the current state of user.name, user.email and the error attribute is always flagged appropriately. However, within ...
0 votes
1 answer
68 views

Bloc State not reload or updating widget ui when i was emit a list

i try to change listSelctedTest with add/remove function in bloc, but my ui widget not reload/update after emit a listSelectedTest. but, if using ctr+s/hot reload it will change to new value and ...
0 votes
4 answers
2k views

FLUTTER -BLOC is not updating state even with copyWith() and equatable

I have created an event for radio button like functionality where user can select only single element at a time. But when I trigger the event to select the value, it does not update the state, however ...
5 votes
2 answers
4k views

GetAuthenticationStateAsync in custom AuthenticationProvider not firing - Blazor Client

I am having trouble with my token expiry. The token expires on the server side but on client side it shows expired only when I hit F5. App.razor code <CascadingAuthenticationState> <...
0 votes
1 answer
29 views

How to use blocbuilder in another blocbuilder in Flutter

I have wrapped the inkwell widget with a BasketBloc and in basket_event i have a function AddProduct which literally adds the add product into the basket and the code for that is as follows: onTap: () ...
0 votes
1 answer
8k views

How to make a loading page on nextjs 13

Hi im trying to get a loading page to show while website is taking the time to load. as it quite a large website I thought a loading screen would provide the best possible user experience however I ...
1 vote
1 answer
31 views

Setting checkbox input checked value based on checked state

I can successfully add in the value and checked state of an input to a state array, so when I click on an input, the value and checked state get pushed to the array, and when I click it again, the ...
9 votes
2 answers
9k views

Jstree state plugin not saving tree state

Adding the state plugin in Jstree is still not saving the state of the tree between page refresh or after clicking link and going back to previous page $('#myGrid').jstree({ "types": { "...
-1 votes
1 answer
34 views

React using toggle switch to change state of sibling components

I'm working on an app where I want to change a value from lbs to kgs. I currently have the state set to lbs and am trying to add a toggle switch which will allow users to toggle between lbs and kgs. I'...
0 votes
0 answers
48 views

TypeError: Failed to execute 'insertBefore' on 'Node': parameter 1 is not of type 'Node' In vue3

Facing an issue in the Vue project after upgrading the version of Vue2 to Vue3. In one of the scenarios, I'm upgrading the Vex state value with the existing value. As we know, after the state upgrade, ...