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
votes0
answers12
viewsReact-PDF | If I add props, I can’t download it
Hi, can you help me? I need to export an "extract" in React, This extract is generated dynamically. I did a web search and found the lib React-PDF. Until then ok. I managed my document and…
-
0
votes1
answer24
viewsError 'Typeerror: Cannot read Property 'room' of Undefined'
I’m developing a real-time chat application, using Reactjs on the front end and Node.js on the back end. I configured the Node server with Socket.io for the application. When entering the chat page…
-
0
votes0
answers23
viewsHow to prevent a carousel from slipping when it reaches the last item?
I’m making a carousel from scratch, it contains 7 items, the problem is when it gets to the last item I can still click to the next one, I want every time I get to the last item the carousel stop.…
-
0
votes1
answer112
viewsReact - Initial error in the checked Switch property (React-Switchery)
I’m using the library’s Switch component React-Switchery in the React, on a work project. I used it on several screens without any problem, but in a specific screen the following occurs: even with…
-
0
votes0
answers63
viewsError: Objects are not Valid as a React Child (found: Object) If you Meant to render a Collection of Children, use an array Instead. nextjs/typescript
I have the following problem with nextjs/typescript I have a cart context where is giving the second message, I tried to change the types already tried to do several things but the error persists,…
-
0
votes1
answer33
viewsHow to Clean Formalario in React
So guys I’m having a problem, I made a formalario that sends input data by Submit to an API, but I can’t file the data after Submit. export default function Home() { const initialValue = { nome: '',…
-
0
votes1
answer25
viewsOpen isolated dropdown with useState and useRef
I have a sidebar where I’m using a dropdown while hovering over each icon on that sidebar. I am using useState to open the dropdown and would like to use only one state for everyone, but open each…
-
0
votes0
answers29
viewsRemove duplicate data from an object array
I would like to know how do I remove duplicate data from an object array. I tried it the way below, if there is another way better please tell me : I first created two arrays and then merged the two…
-
0
votes0
answers18
viewsProblem with CORS in Reactjs application
I checked on other questions but found no answer that fits my problem. I have a Reactjs application that is on my localhost:3000 and I need to post for my API that is on my localhost:4000. The…
-
0
votes0
answers46
viewsHow to choose only a few items from a . map
I’m making an app similar to facebook, all posts are on a . map: {datapost !== undefined && datapost.map(item => { return ( <div className="publicacao"> <div…
-
0
votes1
answer24
viewsRequest Loop in useEffect
I’m doing a post on my API and want to update my book list whenever I create a new book. My Post is working, but when I add my "list" inside the [list] in use useEffects a Loop is started and the…
-
0
votes0
answers18
viewsI am unable to render Tabnavigation content
I implemented React Navigaton’s Bottomtabnavigation in one app and it has two tabs: home and about. About.js has content, but it doesn’t appear on the screen, I thought it was behind another…
-
0
votes0
answers21
viewsHow to return JSON resulting from POST to the front end and display the data?
Although with some years of programming experience, I’m still beginner in web/mobile development. Please, patience... I researched and tried some treatments but without success, for something that…
-
0
votes1
answer24
viewsReact - When I try to use data from the API using useEffect and useState, the application does not read the data in the component’s Return
I am consuming the Deezer API, using useEffect and useState in Reactjs to list a particular track (an example), but when using the .map, to render, the following error is returned: TypeError:…
-
0
votes1
answer21
viewsDo not insert null data sequence in Loop POST Reactjs
I am inserting a table in Mysql with a Loop, if the user does not type anything in the two fields: "quantityUsada" and "numeroLote" of the same index, I do not want to save in the database, would…
-
0
votes0
answers17
viewsHow to use history.push() with state parameter and also href to call the same route?
My application has private screens on which the user can browse freely, but when trying to access some private area, the user is redirected to login screen. I would like the user to be redirected…
-
0
votes0
answers9
viewshow to chain asynchronous actions with Redux thunk
I am trying to make two actions, being addToFavorite and removeToFavorite, be updated immediately upon hearing the click of a button, updating the "Favoritar" button to "Remove from favorites" or…
-
0
votes0
answers11
viewsGlobal CSS related error while running project
I have two other projects with the same file structure and that are running (npm run dev) usually but this third one ends in error and does not render the default page of a project with next.js.…
-
0
votes0
answers14
viewsPercentage Calculation React.jsx
Good afternoon, I’m new here. I’m racking my brain to find out how I’m going to be able to do a percentage calculation on the calculator I’m creating, I can’t make it happen. The other operations…
reactasked 3 years, 2 months ago Vinícius Castro 1 -
0
votes0
answers20
viewsAxios doing two post with only one request
Good afternoon! How are you? I am trying to register a user and his restaurant. So I first post the user data and on . then send me to the restaurant registration route. It makes the user’s…
-
0
votes0
answers10
viewsRoute redirection in REACTJS
I have an React app that has public route (Login), private routes (Dashboard) and sub routes, which are the contents according to menu options. This is an Aside that holds the menu, and the right…
-
-1
votes1
answer746
viewsUpload Files to React Native
Good afternoon, everyone, I am starting the programming in React-Native and I have a question about using Forms to upload files. It is possible? Thank you.
-
-1
votes1
answer120
viewsClose modal Ant Design with ESC
I need to close an Ant Design modal with ESC. I am using React. I have this function that closes the modal, but I’m having difficulties to implement in the code. Can you help me? handleOk = (e)…
-
-1
votes1
answer721
viewsHow to pass data from a table to a PDF report using React and JSPDF?
Follows my code: exportar = () => { var doc = new jsPDF() var d = new Date(); var texto = "Generator PDF" var mes = d.getMonth() + 1; doc.setFont('times', 'bold') doc.setFontSize(14) doc.text(10,…
-
-1
votes1
answer317
viewsHow do I integrate React into a MVC (PHP) structure?
I am learning PHP and I came up with a question: With React, we have the CLI, which is a structure already ready for you, with all the necessary files. In MVC we built a structure separating the…
-
-1
votes1
answer54
viewsClass pass function
I need to use the same button on different pages and with different functions How can I pass the function to the button ? class App extends Component { render(){ return( <View> <Button…
-
-1
votes1
answer72
viewsError loading localhost
When running my React Native code in the Xcode simulator, it returns some error in localhost. But I didn’t touch the code, I just created the project and ran it.…
-
-1
votes1
answer145
viewsMedia queries within nesting - Sass
I have a question, I am creating an application in React, so I am using SASS. But my doubt is related to SASS, if it is a good practice I insert media querie inside my css block. Example I’m doing…
-
-1
votes1
answer2227
viewsGraphics Component for React Native?
Hello I am new in developing with React Native, there is some good graphic component for the platform?
-
-1
votes1
answer152
viewsError Installing Gradle
Hello guys someone has seen this error when the application tries to install Gradle, be it in android studio, Ionic, React-Native, all give this same error when I try to compile the project Both…
-
-1
votes2
answers817
viewsIs it possible to pass parameters from one route to another without going through the url in reactjs?
I’m learning reactjs and in the application I’m developing I have a login screen that authenticates the user to access a private route. On this private route I would like to load this user’s data…
-
-1
votes1
answer1701
viewsHow do I update a component of another class in React?
I’m new here at the forum and I’m studying Act and I came across a question.. I have the following files: App.js class App extends Component { constructor(props) { super(props) this.state = {…
reactasked 6 years, 6 months ago Matheus Roversi 1 -
-1
votes1
answer996
viewsModule not found: Can’t resolve 'Assets/css/custom.css'
I have a small problem when starting my project in React, when running the command Yarn start the terminal returns me the following error ./src/index.js Module not found: Can't resolve…
-
-1
votes1
answer40
viewsTextarea similar to a Text Editor ex: VS Code
I wonder if you have more lib for React that leaves a textarea equal to VS Code for example? lib closest to what I found was the Codemirror, I would like more auternativas.
reactasked 5 years ago Rafael Sene 103 -
-1
votes1
answer871
viewsHow to use the "parent" component function in the React child
I have a component Menu import React, { Component } from "react"; import "./Menu.css"; import { connect } from "react-redux"; import Sidebar from "react-sidebar"; import SidebarContent from…
reactasked 4 years, 11 months ago Matheus Ribeiro 143 -
-1
votes1
answer59
viewsChange input color when data is not valid?
That code works: this.state = { backgroundcolorQuatro: '', backgroundcolorSeis:'', backgroundcolorDez:'', quatro:'', seis:'', dez:'' } validar = () => { if (this.state.quatro !== '4') {…
-
-1
votes1
answer247
viewsHello World in React.JS does not work!
I’m trying to print a "Hello World!" on React.JS Look at my code, it just doesn’t work: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <script…
-
-1
votes1
answer3323
viewsReact and React-Native array.map
Many collaborators come to ask me how to realize a map in an easy and uncomplicated way and that every time they search on the Internet is around the world. but anyway, come on: I create a state…
-
-1
votes1
answer193
views(React) Bootstrap overwriting my css
Hello, everyone. I’m a beginner with React and I was developing a front-end application and decided to use the bootstrap to make a slide. I installed the bootstrap through npm install and installed…
-
-1
votes1
answer30
viewsMy simple classname logic is not comparing right (React)
I’m making a comparison logic within Classname, follows: <button className={'OVERDUE' || 'CONFIRMED' || 'RECEIVED' === 'PENDING' ? 'YES' : 'NO'} onClick={ () => this.showModalEdit(payment)}…
-
-1
votes1
answer134
viewsCan React Native’s Yellowbox be ignored?
At some points in my application, React has errors in Yellow Box, for example: Each Child in a list should have a Unique "key" prop. I know it’s possible to disable them, but can it cause any…
-
-1
votes1
answer61
viewsSpring Boot Map Static Files (React)
My question is, how do I map static files, for example in Nodejs using Express, I can: app.get('*', (req, res) => { res.sendFile(path.resolve(__dirname, '../build', 'index.html')); }); So all…
-
-1
votes2
answers909
viewsSource Problem in React Native
I’m having a load problem with React On, I’ve installed both fonts for my project and it was working fine until I stopped working for a while because of another error. When I returned to try to…
-
-1
votes1
answer66
viewsRenaming methods of imports?
First I’d like to know if I can call elements that we import of methods, that is to say: import { Icon, Button, cabecalho : Header} from 'semantic-ui-react' Could I call Icon, Button or Header…
-
-1
votes1
answer448
viewsUpdate an array in React state?
I’m trying to extract the elements from a array and move on to another array in the state more still unsuccessful, my code is like this: this.state = {lista[]}; //(No metodo) let v = ""; for(var…
-
-1
votes1
answer303
viewsUnexpected behavior when updating component status
I’m working on a project with many components, and most of them need to share the same state, do it through props works, but is difficult to maintain, if a child component needs any more value, it…
-
-1
votes1
answer264
viewsHow to make a Mask input that has more than one mask possible?
I am making a form and using the React-input-Mask component. I am in the phone field part, and would like to accept either the '(99) 9999-9999' or '(99) 9 9999-9999' landline format, but after…
-
-1
votes1
answer635
viewsReact Native error when running npx React-Native run-android
This error is appearing to me when I use the command npx react-native run-android, how can I solve this? error Failed to install the app. Make sure you have the Android development environment set…
-
-1
votes1
answer531
viewsWhat’s wrong with running the React-Native app?
Hi, I’m trying to run my React app Turn on via command sudo React-Native run-android But always returns me the following error message: FAILURE: Build failed with an exception. * What went wrong:…
-
-1
votes1
answer690
viewsAttempted import error: 'Yup' does not contain a default export (Imported as 'Yup'). NPM
I am creating a site with authentication service and in it I intend to use Yup, an NPM module. I installed everything right but when I start the application it appears: Attempted import error: 'yup'…