Questions tagged [state]
The contents of memory locations, at any given point in the program's execution, is called the program's state.
9,121
questions
0
votes
2
answers
16
views
Flutter: Is it safe to hold state variable for StatefulWidget?
late State<MyHomePage> myHomePageState;
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() {
myHomePageState = ...
0
votes
1
answer
21
views
React update nested objects with input name
Lets imagine we have the following state:
const [sample,setSample] = useState({
key:{
value:'',
otherValue:''
}
});
Now we all know that if we use name=key on an input like ...
0
votes
0
answers
16
views
Axios get request using React useState to store data - data is null
When I make an API request and then attempt to set the state to the results from the Axios request (after formatting the data a bit) it doesn't work. The request is fine and I'm able to store the data ...
0
votes
0
answers
22
views
How to make external state reactive with Vue 3
I have a scenario where some state is managed by an external JavaScript library. I want this external state to become reactive to use it e.g. in the template. The state changes in the background based ...
0
votes
0
answers
16
views
Change flutter app theme at runtime without resetting the app state
I want to change my flutter app theme at runtime but I am running into some problems.
The problems are that I am using go router for navigation and the option to change theme is on on 4th shell route ...
1
vote
1
answer
43
views
Flutter: get state from StatefulWidget?
Is there a way to get the state from a StatefulWidget?
class HomePage extends StatefulWidget {
const HomePage({super.key});
@override
State<HomePage> createState() => _HomePageState();
...
0
votes
0
answers
18
views
How to store user state on client side?
I have a MERN app with the frontend and backend deployed separately. I'm using passport to authenticate requests to my server using session cookies which works just fine.
I want to display some of the ...
0
votes
1
answer
12
views
How to different invocations of same state machine in parallel?
I have a state machine that gets triggered based on a file on S3 bucket using an event. If 2 files come one after the other, two executions of state machine starts running. I do not want that. Instead ...
0
votes
0
answers
12
views
angular animation state mismatch
I'm strugling with animation state of expand/collapse button on the collapsible container.
The state of parent container works as expected, but nested button wont match the state of its container.
To ...
0
votes
1
answer
39
views
Unable to reset form
I have been trying allday to reset the file selection once the upload button has been pressed, it looks like I should be used a useRef to reset the value back to null however I can't seem to make it ...
0
votes
0
answers
8
views
Android listen_call_state
I made an app that starts a call. If the call drops, the number will automatically be called again. The app no longer works with Android 13. Apparently this is because "LISTEN_CALL_STATE" ...
0
votes
3
answers
62
views
SwiftUI: Bound @State Variable Not Updated When Showing Sheet
I am experiencing an issue with SwiftUI where a bound @State variable (displayString) does not seem to get updated in time when a sheet is presented. The code provided consists of a parent view (...
0
votes
0
answers
8
views
Legend state persistence plugin is not setting on local
I am trying to working with legend state persistence plugin in local. I do all the setups and imports are ok.
But localstorage value is not setting. And indexDB's database name legend and table `store'...
0
votes
0
answers
21
views
React: Intersection Observer Is not updating states
Goal is to make kind of an infinite scroll with intersection observer where whenever user scrolls to the bottom, new things appears. Now the original code is too long so here is a simplified version ...
1
vote
1
answer
22
views
Why Computed component is not re-rendering?
I am using legend state and trying to explore this. And I didn't understand why the <Computed></Computed> component is not re-rendering on state change.
Here is my code.
import {Computed, ...
0
votes
1
answer
22
views
Flutter and Riverpod. Rebuild paginatedDataTable from another page don't works
I have this problem that has been blocking me for days.
My application has two pages:
Page A - paginatedDataTable (reads records from productsGridProvider)
Page B - Form to edit or add a record.(reads ...
0
votes
1
answer
44
views
Vue How to return value from async/await function in a computed
I have a vue js searchbar when i type in the input bar it needs to show results based on the matching characters
For getting the data I'm using async await function to wait for the api response but it'...
0
votes
0
answers
53
views
Next.js 13 State Not Updating on Scroll
I'm facing an issue with my code where the state doesn't seem to update on scroll. I'm currently using Next.js version ^13.4.19. When I include a console.log() inside the useEffect, I'm not getting ...
0
votes
0
answers
14
views
How does MSAL for java play with Edge browser accounts with multiple devices?
We modified the servlet authentication example into a tomcat SSO valve using MSALJ 1.13.10. Works fine for all chrome browsers. However, our enterprise rolled out Edge browser "account sync" ...
0
votes
0
answers
14
views
How to avoid Recoil error 'Setting selectors within atomicUpdate is not supported'
I have some state management code using Recoil where I'm running into the error:
Setting selectors within atomicUpdate is not supported
I understand how this error is occurring. I have some atoms ...
0
votes
0
answers
27
views
How can I delete data from state in React?
When the user presses the add button, addCInputGroup runs and adds newCInputGroup. What I want to do is to be able to delete the dataValues that the user clicked on. When I try this way, it deletes ...
0
votes
2
answers
36
views
Modifying mutableList value outside of composable not saving one parameter, but saving other
I have an object, Day, with 2 required parameters; An id (Int) which is generated in another composable (which is transferring the value correctly), and a values parameter which is a list of Doubles (...
0
votes
0
answers
33
views
runtime-core.esm-bundler.js:41 [Vue warn]: Property "tasks" was accessed during render but is not defined on instance
I'm new to stack so pardon my etiquette. I'm currently learning Vue and Vuex for a job interview and was tasked with building a todo list. When I converted everything over to Vuex, the input for new ...
2
votes
1
answer
24
views
React-Native : Please correct my misunderstanding about how state works - Dynamic text inputs
This is 100% me just misunderstanding how state works in React-Native, and I'm hoping for an illuminating correction.
I've declared my state :
const [players, setPlayers] = useState(["",&...
0
votes
0
answers
14
views
Flutter gesture bar - invisible tile content
I am having this phenomena with the gesture bar on the ios simulator.
The content inside the tile is cut out but the tile itself is visible.
Anyone an idea why?
Of corse, I want the content to be seen ...
0
votes
0
answers
16
views
React - Child components not updating when setting the parent's state too quickly
I have a big form with around 1000 dynamically rendered inputs (based on a database table) and each have their own reference in the parent's state array inputs. Here is the structure of said array :
[
...
0
votes
0
answers
27
views
ReactJS why onClick is going to trigger two methods instead of one [duplicate]
I have two methods addItem and removeItem.
I have also two buttons for these methods via onClick.
When I click on addItem button then both methods are triggered, please why?
<button id="a"...
1
vote
2
answers
56
views
Non-hacky way to share a boolean state between classes?
Say I have
class Cat:
def __init__(self, var, n_calls=None):
self.var = var
if n_calls is None:
self.n_calls = []
else:
self.n_calls = n_calls
...
-1
votes
0
answers
20
views
Passing props between not "relatives" components using redux
i'm approaching mapStateToProps and mapDispatchToProps, i made a component called Prova.js that contains the props i want to be shared between my components, here it's:
import React, { Component } ...
0
votes
0
answers
13
views
Flutter cubit2cubit communication
I have a CandidateListCubit that holds a list of candidates in a success state(CandidateListSuccess). I also have DecideCandidateCubit. The function of this cubit is to give the admin the authority to ...
0
votes
1
answer
17
views
Error after rotating screen on Flutter. Dependets is Empty
I have an issue. When I navigate to a screen and rotate to landscape to reproduce a video, and then I go back to a portrait screen, I get this error:
Another exception was thrown: 'package:flutter/src/...
0
votes
1
answer
51
views
How to convert a state to an index with Julia code [closed]
I'm going to make a matrix with Julia code, but I'm going to convert the state in rows and columns to index first, so please tell me how. For example, I'm trying to convert the state of a row called (...
0
votes
1
answer
26
views
Issue writing first React application - Simple interactive form
After an 8 year break from web dev I thought I'd try learning React. I started with this small interactive form that calculates the cost to run a Sodastream machine. All it does at the moment is add ...
0
votes
0
answers
17
views
Persist angular application state to external database
I have complex angular application with many components, I am using reactive forms.
When user is done finishing different UI screens (around 10 different tabs), they can press "Save" button ...
0
votes
1
answer
54
views
Blazor server component property state is lost
In blazor server I have found references online that property state can be kept when the method OnInitializedAsync is called twice (ServerPrerendered)
Everytime when I try, currentCount has the ...
1
vote
1
answer
46
views
SwiftUI Compile Error When Using @State Property with AssociatedType
I encountered an issue in SwiftUI while working with a @State property that conforms to a protocol containing an associatedtype. This property includes an array of associatedtype elements that I need ...
2
votes
1
answer
56
views
How to add dynamic classes in VanJS?
I've been playing around with VanJS and building the same app I do with every new JS library I want to try out.
In component/class DividerList I'm defining a dynamic HTML class which should have the ...
0
votes
1
answer
36
views
button with loop animation and states swiftUI
I have button with animation:
enum RecordState {
case recording
case notRecording
case none
}
struct RecordButton: View {
@State private var isRecording = false
@Binding var ...
0
votes
1
answer
22
views
Terraform init puts an empty state file in my remove GCS backend but then creates a local state file
I'm running terraform from a GCP compute instance to create projects using https://github.com/terraform-google-modules/terraform-google-project-factory
The definition seems correct--terraform creates ...
-1
votes
1
answer
50
views
State not being lifted in React project because of TypeError:
I'm following two React courses on the "lifting state up" portion of State management and I'm having issues with the "lifting state up" concept on React and they are rejecting my ...
0
votes
0
answers
16
views
Toggling selected states between multiple objects using ID from .map()
I'm attempting to toggle a selected/not-selected state for clickable cards being rendered using a .map(). I've found an example of the desired outcome I'd like to recreate, but haven't been successful ...
0
votes
0
answers
58
views
Flutter Riverpod infinite loading while using a controller that fetches data
I'm struggling with understanding the issue that I end up in. My FutureProvider can't depend on a Controller that has asynchronous added data. I would love to understand the mechanics that lead to ...
0
votes
1
answer
37
views
React useState not seems to be working with eventlisteners (Next.js)
I am trying to create a webpage which have a fixed hamburger icon on the top right and when clicked opens a navbar. If user clicks outside of navbar, the navbar should be closed and hamburger icon ...
0
votes
1
answer
25
views
Creating your own states in Tailwind CSS (hover:bg-sky-700, dark:bg-slate-800)
Good Day Evryone.
Im new in tailwind css. Im using tailwind with react.
I want to create my oun states words, like hover:... or dark:.... This, in my opinion, would be very convenient. But I don't ...
0
votes
1
answer
38
views
All my components share a similar state and I would like them to have their own state
I am currently working on a small project to understand the functionality and implementation of Room. So far, I have made good progress.
However, I am facing an issue with the checkbox state. Whenever ...
0
votes
0
answers
76
views
I can't figure out `FSMContext`, `State` in `aiogram v3.x`. I'm writing a registration system
As a result of my "misunderstandings", the show_summary function in the code below is not outputting values correctly. This is what is output in (show_summary):
The following is a summary of ...
0
votes
1
answer
27
views
Flutter UI State only updates when I hot reload
so heres how it looks like:
when i press add and input any data it saves it but doesnt update the ui so for some reason only when i hotreload it updates dashboarditems list to like this:
idk what ...
0
votes
1
answer
19
views
reactive statement that runs every time any state variable changes
I am trying to write a simple app. The app has two child components. Each components represents a team. The score begins from 20 and the group which loses all points 0 lost.
my parent component has ...
0
votes
0
answers
21
views
Question about Unity animatior state control
I'm trying to build up a state machine and having troubles with state transfer within Animator
I've written a script where
it's available to cast skill
transfer occurs from any state to Skill State
...
0
votes
1
answer
41
views
Is there a way to block web visitors from certain states from seeing a website?
I have a pharmacist client who makes compounds but can only service customers in Georgia. He gets a lot of calls from out of state people, is there a simple way to block people from out of state from ...