Most voted "react" questions
It is an open source Javascript library for creating user interfaces. It is maintained by Facebook, Instagram and a community of individual developers and other companies
Learn more…1,420 questions
Sort by count of
-
0
votes2
answers176
viewsDatepicker component breaking the screen in editing
I created the following component to select dates in Unform: export default function DatePickerInput({ name, ...rest }) { const datepickerRef = useRef(null); const { fieldName, defaultValue = '',…
-
0
votes1
answer82
viewsReact :: exchange part of a string for tag input
I’ll describe what I have in my component: I get an API string with part of the content between * and I must exchange this part of the text for a <input />. You can have more than one piece of…
-
0
votes0
answers312
viewsHow to format antd Inputnumber to accept "," to decimal and "." to centesimal
Hello, I’m using antd’s Inputnumber. In this example below antd is using regex so it formats the number, but it only accepts "." so I couldn’t just type "10.5" but "10.5" <InputNumber…
-
0
votes0
answers130
viewscreate-React-app by only creating Node module and package.json
I have a problem trying to create an application with React. Using the command npx create-react-app only is created the node_modules and the package.json and no more template that should come. I…
-
0
votes2
answers1497
viewsHow to use the Material Ui autocomplete Component without errors
I have a component Autocomplete of the Material UI where the user searches the values based on an array of products that comes from an API. The component is like this, where products is the array,…
-
0
votes1
answer127
viewsHow to pass an array and the array set by the value of the Provider (CONTEXT - TYPESCRIPT - REACT)
How to pass the value of the list and sector? import React from "react"; interface Lista { nome: string, empresa: string, ramal: number } const listaInicial: Lista = { nome: "", empresa: "", ramal:…
-
0
votes1
answer2216
viewsTable filter by name in React
I’m developing an application in React where it shows a table with data from an Array that comes from an API, put a filter to search by name and the table changes according to the user’s input. The…
-
0
votes1
answer1015
viewsHow to read specific information from a JSON file in Reactjs?
I’m having trouble rendering specific information in my code, for example, I would like to render only the "id":1, and the information contained in it. However in the code it renders the information…
-
0
votes1
answer123
viewsTypeerror: Contacts.map is not a Function
Hello, I searched on the subject and saw that it may be an error that may be due to not receiving an array. However, I put to be returned an array in the API, can be consulted here…
-
0
votes2
answers165
views"setState" problem using React
I have a code in React that uses the hook useState in that way: const [tarefas, setTarefas] = useState([]); It is a task list code, every time I remove a project I have to update the project of each…
-
0
votes1
answer43
viewsHow to modify a nested object in React?
I’m having trouble modifying the properties of the address, the way it is I can only change the name up to the phone, could someone tell me a way to modify them? const dataInit = { name: '', email:…
reactasked 4 years, 5 months ago Randel Freitas 11 -
0
votes1
answer177
viewsHelp with API/useEffect - React
I need to make a call to the API with React and for that I’m using Axios. Doing a test with the code below, on the console I can see the result: const [bill, setBill] = useState([]); useEffect(()…
-
0
votes1
answer511
viewsManipulating buttons in React.js
I am creating a small task system for a collaborator in the company where I work, it should display the tasks that must be completed on the day, until then I was able to display the tasks my problem…
-
0
votes0
answers35
viewsFill the Select component only by clicking
I’m with a project that when entering the component it carries the modal information, because the modal is with useEffect useEffect(() => { buscarPlantas(); }, []); But I want this list only to…
-
0
votes1
answer70
viewsStatus of the array not updated with Sort
I’m pulling an array with a user’s repositories on github and need to sort according to the number of stars, with the option of increasing and decreasing. I thought: when the user clicks on the…
-
0
votes1
answer80
viewsReact Nextjs - Path of the Undefined parameter after giving Refrech ( F5 ) on the page
Note: Eco Systems used here: Nextjs, Adonisjs and Mysql I have following code where I make a news presentation, what happens is the following... right after I come from the news listing, and select…
javascript node.js react adonisjs nextasked 4 years, 4 months ago Carlos Gustavo Souza Guimarães 42 -
0
votes1
answer209
viewsReturn of onPress within Components
Good night. I’m having a little problem with the return of an Onpress from a Touchableopacity, inside an element. Basically, sometimes it returns the action, but most of the time it does not. The…
-
0
votes0
answers45
viewsRender notification component on screen
Hello, I’m trying to render a notification component on the screen when the Ubmit button is clicked, however I’m returning the component directly in Return, it’s not working because it’s the wrong…
-
0
votes1
answer467
viewsRoute component does not render - React
I’m having trouble rendering the component when I navigate between routes using history. It turns out that simply the route component is not rendered when I give a history.push('/path'). The url…
reactasked 4 years, 4 months ago Gabriel Otto 47 -
0
votes1
answer51
viewsHow to change the pre-name of classes generated by Material UI
Hello, I am creating a project that uses Material UI and I realize that when I compile it generates the classes in production of JSS ex: I’m used to working using css modules together with the…
-
0
votes1
answer31
viewsProblems when rendering React component after filter array
Good night, I have a method that filters an array and arrow the state variable "transactions" with the result of this filter = newArrayTransactions, as you can below. The child component that passes…
reactasked 4 years, 4 months ago Aniello Sansone Filho 11 -
0
votes2
answers47
viewsWhen I use the <Link> it from this route error, what can it be?
I’ve reinstalled React-Router-Dom, and I can’t fix it.…
-
0
votes3
answers37
viewsDoubt in the execution
I am attending the basic course of Reactjs of João Ribeiro, and in class 17 he writes the following code: class App extends React.Component { metodo = (texto) => { console.log(texto) } render() {…
-
0
votes1
answer1200
viewsHow to use the integrated React-select with Unform without typescript?
I’m studying React and in particular a library to create forms that is Unform, was managing to create the Components until I came across a problem. select is integrated with the React-select library…
-
0
votes1
answer43
viewsNode.js does not run correctly
Good morning, afternoon, evening, I’ve been having these problems for a few days, and now it’s crucial I fix it, but my experience is 0 with Nod.js, React, someone can help me out? What I already…
-
0
votes2
answers186
viewspreventDefault() does not work
Good evening, I’ve searched all the forum on the internet and I haven’t found anything to solve my problem. I’m studying React, and I’m trying to submit a form, but I don’t want the page to Reload…
-
0
votes1
answer116
viewsFirst value in a map function in javascript
I have a function map Javascript where I return all the photos of a certain record. Among these photos, one of them has to receive a text, which in my case is Main photo, which will always be the…
-
0
votes1
answer217
viewsParsing error: Unexpected token React
The error appears in this.converter = this.converter.bind(this); My script: import React, { Component } from 'react' export default class conversor extends Component { constructor(props){…
-
0
votes1
answer49
viewsWhy do I get the message from Property is Undefined even with Arrow Function?
I’m starting with React and can not understand why the code below does not work. I receive the following message: "Typeerror: can’t access Property "aoClicarNota", this is Undefined" I’m already…
-
0
votes1
answer54
viewsCSS does not access HTML subclasses in React
I’m having trouble accessing one class within another. I have the function Banner: import React from 'react'; import './Banner.css'; function Banner(props) { return ( <div className="Banner">…
-
0
votes1
answer65
viewsHow to add the answer to an Axios request in an Array?
I am trying to put the answer to an Axios request inside an array, but I am receiving as a response a strange structure, as I will show in the following image: I created an Array, added my own name…
-
0
votes1
answer193
viewsHow to customize Swiper React.js Arrow in jsx or Styled.Component
I want to customize the Arrows of Swiper, but I found nothing in the documentation. This is the code of my navigation: const params = { navigation: { nextEl: ".swiper-button-next", prevEl:…
-
0
votes1
answer21
viewsCreate javascript object with other objects
I need to take objects from Java arrays that I receive from the backend and transfer them to other objects to be able to use in the React-select library. My object comes from the backend like this:…
-
0
votes1
answer58
viewsCharacter counter Event.target.value in useCallback does not update to zero
I am creating a character counter that needs to be updated according to the amount of characters typed in the text field. The result of the function must be a message that specifies the amount of…
-
0
votes1
answer46
viewsManipulating Async/Await function return with JSON.parse - REACTJS
I have the code below that is returning an error where I am not understanding how to solve. The log console of "Ret.value" returns {"id":1,"name":"Max"} string correctly, but in JSON.parse. Argument…
-
0
votes1
answer40
viewsProblems adding Spotify script with reactJS
I was trying to link the Spotify API script to the React component, but when I use the "window.onSpotifyWebPlaybackSDKReady" function it shows the error:"Property onSpotifyWebPlaybackSDKReady does…
-
0
votes1
answer155
viewsHow to create multiple React components dynamically using Hooks?
I’m making an app on React which calculates compound interest and would like to know if anyone knows how to create several components at once dynamically. Example: if I put 12 months I will have to…
-
0
votes1
answer41
viewsWhy can’t I trigger a function in a <div/> daughter tag in React?
I am using the Unform package to create a form in React and have the following function that renders the form: function FormularioCliente() { function handleSubmit(data) { console.log(data); }…
-
0
votes1
answer180
viewsBrowse map array with tsx
I need to traverse an array within another array with array map, in the first loop I will show the categories and in the second I will show the products, I am able to go through, but I cannot show…
-
0
votes1
answer63
viewsJust open the clicked modal?
I have a map of a array object. <S.Section> {data.slice(oldItems, showItems).map((it, index) => { return ( <> <S.Box key={index} onClick={openDetails}> <S.Image…
-
0
votes0
answers29
viewsWarning on Reactjs routes
I have the following custom route configuration <BrowserRouter> <Switch> <IntroducingLayoutRoute exact path="/" component={Main} /> <IntroducingLayoutRoute path="/about"…
-
0
votes0
answers281
viewsConfiguration of . htaccess for Nodejs and React application using the same domain
Hello, I am configuring an application on a cPanel server. The backend was developed in Node JS and will be published in a URL with the following format: https://teste.com/api; The frontend was…
-
0
votes1
answer79
viewsusing useEffect, setState and Sort for Array
I am using React Hooks to sort an array list by the 'points' item after I update an object item. After much tinkering with the code I managed to sort the Array in the 'Sorted' variable using useMemo…
-
0
votes1
answer256
viewsStyled-Component does not activate style
I’m making a clone of Discord, on TSX, using Styled Components. However when I create the Tyled.ts, I notice by the indentation that the style was not applied. Meu Json: How does it look: As it…
-
0
votes0
answers48
viewsSocket.io in React.js. When a socket is sent, can I retrieve the sent object through the socket id?
I am using socket.io on my system so that every time a user registers appear in real time on my screen. For this I am saving the socket in the mongoDB database, but it saves not only the connected…
-
0
votes0
answers62
viewsScroll bar does not load correctly when changing page with Reactjs
I have a problem with an application in Reactjs, I am using the library React-router-dom to navigate between pages, and when switching pages in my application when the page component is too large…
-
0
votes1
answer23
viewsHow to insert multiple phones in a tag next to, from a enter or tab, or even a button? React
I want the phone input, when adding, and the user click enter or tab, (or even an add button or +), it inserts the phone in the side tags, (can be below or even within the input itself - just like…
reactasked 4 years, 2 months ago Rebeca Nonato 1,163 -
0
votes2
answers631
viewsReact js - Update a Parent component list/array through the Child component state
Good evening, I’m new to React, I come from Java/C# programming and I’m having a hard time understanding things that might be simple in React js. My question is the following, I need to update a…
-
0
votes1
answer22
viewsIs it possible to set the number of items displayed in a material table per device?
I’m doing a project in React and I have a component that makes a data listing using Material Table. By default I set to display 10 items per page, but in mobile it is bad to have so many items,…
-
0
votes1
answer66
viewsCSS in React: Component disappearing when using position Absolute
Talk people, good afternoon! Next, I have a problem related to my css and I’m not able to solve. The problem occurs because in a <ul> i have 3 button icons(accept, cancel and edit), I want to…