About 54,000 results
Open links in new tab
  1. javascript - How to update state with usestate in an array of …

    Jul 16, 2020 · let updatedList = state.todos.map(item => { if (item.id == id){ return {...item, done: !item.done}; //gets everything that was already in item, and updates "done" } return item; // else …

  2. Update Browser State Without Reloading Using JavaScript URL

    Dec 13, 2024 · This article explores how to use JavaScript to update the browser's state dynamically and create seamless navigation experiences.

  3. javascript - How to update state? - Stack Overflow

    Jan 14, 2018 · I am trying to update state with API. I tried to update API state with using setouttime, in render(), there is if statement which if timepassed is true, this.get_bus will be …

  4. History: replaceState() method - Web APIs | MDN - MDN Web Docs

    Mar 27, 2025 · The replaceState() method of the History interface modifies the current history entry, replacing it with the state object and URL passed in the method parameters. This …

  5. javascript - How can I update state.item[1] in state using setState ...

    I want to update the state when the user changes any of the values, but I'm having a hard time to target the correct object: handleChange: function (e) { item = this.state.items[1]; item.name = …

  6. Updating Arrays in State – React

    Instead of mutating an array, create a new version of it, and update the state to it. You can use the [...arr, newItem] array spread syntax to create arrays with new items. You can use filter() …

  7. Updating Objects in State – React

    State can hold any kind of JavaScript value, including objects. But you shouldn’t change objects that you hold in the React state directly. Instead, when you want to update an object, you need …

  8. Fetching Data and Updating State with Hooks - Pluralsight

    Dec 19, 2019 · The useState hook returns the state value and a function for updating that state: import React from 'react'; function BooksList () { const [books, updateBooks] = …

  9. javascript - Accessing up-to-date state from within a callback

    Sep 9, 2019 · We use a third party library (over which there is limited control) that takes a callback as argument to a function. What is the correct way to provide that callback with the latest …

  10. Back to Basics: Mastering State Management in Vanilla JavaScript

    Dec 11, 2023 · This article will guide you through the principles of state management in plain JavaScript, showcasing how you can effectively manage, update, and share state across your …

Refresh