Questions tagged [controlled-component]
89 questions
2
votes
3 answers
react-native-material-textfield Doesn't work as a controlled input
I'm using "react-native-material-textfield" for text inputs. I have a View to edit user details it fetch values from api when mounting and set it to state. But after upgrading "react-native-material-textfield" to "0.16.1" that original first name…

JasonSteve
- 37
- 1
- 6
2
votes
1 answer
props.names.map is not a function
I have a react component called App that contains 2 components: Form and Table. And both of them are controlled component.
In the form, there is an input element and a button.
The input element has an onChange attribute; whenever the value changes…

Eddie Lam
- 579
- 1
- 5
- 22
2
votes
3 answers
How to create Vuejs controlled input form?
I'm used to creating controlled components in react using state; however, I'm new to Vue and would like to learn how I could recreate my code from react into something Vue could use. I want the input fields values to be store in a piece of data so…

albert_anthony6
- 594
- 2
- 9
- 30
2
votes
1 answer
2
votes
2 answers
How to make controlled input component in Redux?
I'm implementing movie search functionality using the moviedb api. I have implemented in React only but I want to do it in Redux. Here is my approach in React.
Header.js
import React, { Component } from "react"
import { Navbar, Form, FormControl }…

hellraiser999
- 91
- 2
- 13
2
votes
4 answers
ReactJS OnKeyUp event not getting value on controlled input
I'm building a ReactJS search component for data filtering through search.
The idea is that the user types a word, letter after letter, and the system will filter all registers containing that word. The basic component is detailed below:
class…

Mendes
- 17,489
- 35
- 150
- 263
1
vote
1 answer
Despite using 'onChange', why my input looses focus after any key press?
I've just started learning React and I'm trying to build a todo list including edit button. I defined an input inside tags through a condition in component. but when i click on edit icon to rewrite a task, with the first keypress the focus is…

Sahba Rez
- 13
- 2
1
vote
1 answer
MUI - Select without initial value throws warnings & errors
I'm trying to use a controlled react MUI Select element with a few options, but the initial value must be empty (no initial value - empty selection). This sounds like a pretty common behavior. I do not want one of the options selected by…

Metheny
- 1,112
- 1
- 11
- 23
1
vote
2 answers
Warning: A component is changing an uncontrolled input to be controlled. Minimum working example
When selecting an item, the following warning is raised:
Warning: A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between…

Sebastian Nielsen
- 3,835
- 5
- 27
- 43
1
vote
0 answers
React controlled checkbox, attribute checked and chrome DevTools
I am learning how to work with multiple checkboxes in react. I use hook UseState. State is array of objects. When i click checkbox, state has changed and UI render fine. But when i open chrome dev tools checked attribute stay the same, whatever i…

Ilya
- 11
- 3
1
vote
2 answers
How do I create a controlled component with an optional value?
In React, I'm trying to create a form in which some values are optional. I have the following TypeScript interface:
export interface DataModel {
title: string,
count?: number,
}
count is optional, but if it's set, it has to be a…

Sharon
- 3,471
- 13
- 60
- 93
1
vote
1 answer
React controlled vs. uncontrolled input form
First of all consider I'm fairly new to react.
I'm building a form with a field is an input. When entering the text into the input I recieve a message saying
Warning: A component is changing an uncontrolled input to be controlled
I look into the…

b81
- 69
- 1
- 10
1
vote
1 answer
React Controlled Form with Child /Parent component
I'm building a controlled form with dynamic fields.
The Parent component get data from a redux store and then set state with the values.
I don't want to make it with too much code lines so I turn the dynamic fields into a component.
States stay in…

Bibi
- 15
- 7
1
vote
1 answer
Ant Design Table component with editable rows and controlled inputs
I am trying to make a Table component with controlled inputs using Ant Design.
I started from Antd doc: Table with editable rows then 1) modularized the code 2) used Hooks and 3) removed the use of Antd Forms.
I have 4…

eakl
- 501
- 8
- 22
1
vote
1 answer
How to create controlled inputs with parameters and passing event object using react hooks?
I am trying to make a form and create controlled inputs, I've used before window.event but this is deprecated and I don't want to use it anymore althought if I use it the solution works as I excepted I am concerned for compatibility, but if I don't…

Endrit Shabani
- 109
- 1
- 6