Questions tagged [state]

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

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

More information is available on Wikipedia.

9107 questions
2
votes
1 answer

Declaring state in NGXS in a sane manner

I'm learning NGXS with the Emitters plugin in Angular, and I have some trouble understanding how to declare my state files in a managable way. I've had success declaring a simple .state file like this: export type PageStatusCases = 'LOADING' |…
2
votes
2 answers

State not updating until 2nd time the form is submitted

So when a session is added and the form is submitted, I want the price of the client to be transferred into the state of my session.. that is what I am trying to do in this part of my code here. state = { id: null, name: null, …
josephT
  • 822
  • 1
  • 7
  • 16
2
votes
1 answer

Updating one State variable changing the data in another state variable

I'm setting the data from api in two state variables both values are same.But when I am updating one state variable the another state variable also changing. Api.get("url") .then((response) => { this.setState( …
ramesh m
  • 151
  • 2
  • 13
2
votes
1 answer

Beginner using chart.js: having trouble display state full of data into a column chart using variables

When I hand code some number into ex: "ColumnChart data={['Sun', 20], ['Mon', 15], ..." the column chart works fine. But I want to use variables in order to transfer the data because later I will be using numbers inputed by the user. How can I fix…
josephT
  • 822
  • 1
  • 7
  • 16
2
votes
1 answer

How to change the state of an particular toggle switch inside the StreamBuilder in flutter

I'm building a school service tracking app using Flutter. Since I'm a newbie to mobile app development I'm facing lots of errors. One of them is, After an user logged in to the app, in the dashboard it will show their children profiles in a card…
2
votes
1 answer

Save value of textInputs on call function React-Native

I am fetching some TextInputs from an API and pushing them to an Array. Then I am saving the input text from user and all keys and values that a textinput object has. However, when I save, it saves every time I make a change on the text. I want to…
showtime
  • 1
  • 1
  • 17
  • 48
2
votes
2 answers

unable to use scoped model in flutter bottom sheet,dialogs

when i run this code it shows an error that correct scopedmodel was not found. i think we have to declare another scoped model for bottomsheet,dialogs also did that using with same model but it behaving abnormally. how do i achive that how to use…
2
votes
4 answers

React component wont display the return of a function

I have a component that is supposed to display a "cards" containing information saved in an array in state. I get this information from a JSON file and save it into my array in a "componentDidMount". I then made a function called "displayFood"…
LAN_scape
  • 77
  • 2
  • 13
2
votes
4 answers

React/Redux Sort Function Not Updating State

I have a simple React/Redux app that displays a list of cars based on my Rails API. I'm trying to add a sort feature that alphabetizes the cars by their name. While my variable orgArray is in fact alphabetized when I console.log it, my Redux dev…
James
  • 411
  • 1
  • 4
  • 18
2
votes
0 answers

Trying to create an Extended Kalman Filter for filtering object detection based GPS data noise

Currently I have a system that measures the GPS coordinates of an object. The object is first detected and then using trigonometry, the GPS coordinates are determined, as we know of the GPS coordinates of the camera itself. However, the camera is…
SDG
  • 2,260
  • 8
  • 35
  • 77
2
votes
3 answers

React- input field turns to string after onChange

I have a small app with three components parent => App Son => Courses Grandchild => Course The app state lies in the App component, in the Course component I have an input field with an onChange event that spouse to change the state in the app…
DavSev
  • 1,005
  • 4
  • 22
  • 47
2
votes
4 answers

React Hooks, how to implement useHideOnScroll hook?

const shouldHide = useHideOnScroll(); return shouldHide ? null :
something
The useHideOnScroll behaviour should return updated value not on every scroll but only when there is a change. The pseudo logic being something like the…
ZenVentzi
  • 3,945
  • 3
  • 33
  • 48
2
votes
1 answer

Passing Firebase User Object To New Component

I'm new to React and Firebase and I'm trying get the user object that's populated after sign in/sign up to a new component so I can access it and create a database for each user, however I can't seem to access the this.state.user from another…
juicy j
  • 183
  • 5
  • 20
2
votes
1 answer

Changing state in React native App.js from another component

I'm making authentication in an app, and I'm kind of stuck. I have 2 different navigations. One shows if the user is logged in and another one if not. Basically, a Sign in screen. It's working fine if I change the value manually upon the start. But…
irondsd
  • 1,140
  • 1
  • 17
  • 34
2
votes
4 answers

React, update single value in state made of array of objects

I am tring to update a single value in the state, this is my state: state = { courses: [ { id: 1, courseName: 'lenguage', courseType: false, courseHours: 10, courseGrade: '' },{ id: 2, …
DavSev
  • 1,005
  • 4
  • 22
  • 47
1 2 3
99
100