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
answers46
viewsDiv is not occupying 100% of the page height
I’m using React.js + next.js + Styled Components to develop the front of an app. In my Layout file I have a Wrapper that makes the other two div’s (Leftcontainer and Rightcontainer) stand next to…
-
0
votes1
answer108
viewsImplement radio Buttons using the unform library
I get the following array of an API: Array Exam: [ { id: 2, question: 'Questão 1:', essay_question: false, value: '2.00', options: [ { id: 1, option: 'Opção A', correct: false, question_id: 2, }, {…
-
0
votes0
answers22
viewsCkeditor 5 does not work on Next.JS
I’m making the following mistake: Unhandled Runtime Error Error: Element type is invalid: expected a string (for built-in Components) or a class/Function (for Composite Components) but got:…
-
0
votes0
answers21
viewsJavascript - Array of various objects, but with content
The problem in question is that I do the request, I receive the data, I push the data inside an instantiated array at the beginning of the code, but when I go to see this array, it says it’s empty,…
-
0
votes1
answer78
viewsMake a global useState variable in React
I’m making an app through the expo with React-Turn on.I’m making a button that when I click I want it to change the height of a Component . I thought of carrying out an export of a variable useState…
-
0
votes0
answers12
viewsBackgroundimage not working on React
I have an application that has the image in the same component folder, as in the image: And I’m using the following inline code to put this image as background: function App() { // Imagem carregada…
-
0
votes1
answer149
viewsProperty 'videoThumb' does not exist on type 'Uniontype'. Property 'videoThumb' does not exist on type 'Image'
I am creating a component with React and typescript and am having this error: Property 'videoThumb' does not exist on type 'Uniontype'. Property 'videoThumb' does not exist on type 'Image'.…
-
0
votes1
answer27
viewsuseEffect does not work when trying to transform Stateful component into Stateless
I have a component that was class-based, and I’m now passing it on to be function-based. The only problem I’m having is that, before, I used the component DidMount() to start the component with some…
-
0
votes1
answer72
viewsHow to expose the son’s Tates to the father?
Good afternoon! I would like to know how to solve this problem. I have a child component that’s like a menu. It contains buttons and currently - according to the click on the functions that are in…
-
0
votes1
answer119
viewsHow to create validation in different fields in the Reactjs form?
How do I validate the form created with Reactjs according to what user reports in the fields? Example: <form> <label for="tipo_requisicao">Escolha uma opção:</label> <!-- Campo…
-
0
votes2
answers40
viewsHow to persist on a route using React router with Reactjs?
I have a site in React, and would like to know how to persist on a route. For example: When I’m on the profile page and refresh the page, it redirects me to Dashboard. Does anyone have any idea how…
-
0
votes0
answers25
viewsHow to receive the event object next to the props of a component in a React function?
Given a call from event onSubmit in any form that activates a function, how can I receive the event object along with other properties? demonstration: const handleSubmit = async ( // OBJETO DE…
-
0
votes1
answer29
viewsAdd a delay to the Buzz Out animation after each loop
Hello, I’m trying to put a delay in my Buzz out animation after each loop, I’m applying it in a text, which is inside the p tag. I’ve looked for several answers and most of them say to put the first…
-
0
votes0
answers18
viewsjest mockImplementation does not work in React navigation (React Nactivate)
I have the following code: jest.mock('@react-navigation/native', () => { return { useNavigation: mockedNavigation, }; }); ... it('should pass the test', async () => {…
-
0
votes1
answer43
viewsHow to add new object at specific position of useState Hooks array
I have the following state in hook on Reactjs: const[faixas, setFaixas] = useState([ {albumId: 1, nome: "nome da musica"}, {albumId: 1, nome: "nome da musica"}, {albumId: 2, nome: "nome da musica"}…
-
0
votes2
answers56
viewsHow to pass a specific object as props in a generation of components?
Hello, I’m initiating the studies in React and when trying to create a code that generates components (in this case the "Box")where at the click of a button passing objects coming from a state to a…
-
0
votes0
answers39
viewsSays you are having memory leak - Warning: Can’t perform a React state update on an unmounted Component
This message appears to me, someone could help me solve? Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application.…
-
0
votes0
answers30
viewsHow to correctly type component props (React) to receive (a and b) or (c and d)
An opinion/tip on the typing of props: Context: An app/site with a list of podcasts in the home, dynamic page for each podcast individually, and in both, play buttons, that plays the relevant…
-
0
votes0
answers20
viewsBlank lines in the datagrid component of Materialui
I have a problem, I am using the Material UI Datagrid component and every time I make a request and return me the data, new blank lines are also created, there is some way to change this component…
-
0
votes1
answer206
viewsReact Hook useEffect has a Missing dependency: 'storeInfo'
I’m trying to use useEffect for a simple function, but error. It is not updating the page and saving the request I make with the function loadAll in the useState. When I load the page the result of…
-
0
votes1
answer30
viewsCreate two Reactjs apps in the same project by sharing node_modules
I am creating a project that has two Apps, one for administrative area and other for the user. Inside the project has the /admin and /user routes, everything works correctly, in the /src folder has…
reactasked 3 years, 6 months ago Joandreiy Cordeiro 381 -
0
votes2
answers35
viewsHow to create a React component that receives a query string and then make a request?
Hello, I’m having a hard time getting a page on React to work. This page receives a query string with token and email, where I should pick them up and make a request for the account to be validated,…
-
0
votes0
answers20
viewsSite Javascript stops working when using history.push for another page
When using the; <a href onClick={() => history.push(`/about`)}> Javascript stops working by locking the page slides and other objects that depend on it. I put javascript in public/js and…
-
0
votes1
answer2038
viewsError: Too Many re-renders. React Limits the number of renders to Prevent an Infinite loop
Eai, I started with reactjs a short time ago and decided to make a site with simple functions to learn, one of these functions would be to list in card format some data I receive from the backend,…
-
0
votes0
answers15
viewsWhen I try to compile error. Error: Invalid hook call
My code was working until I tried to use Styled-Components, it gives this error Error: Invalid hook call. Hooks can only be called Inside of the body of a Function Component. The only thing I did…
-
0
votes0
answers32
viewsProblem with responsiveness in a div with reactjs and Slick Carousel
EN I’m having trouble getting the background of my div responsive, when I lower the screen horizontally and increase vertically, the background is "stretched", making the title and content below…
-
0
votes0
answers12
viewsView information from a specific Firebase collection using Reactjs
Good evening, I’m trying to display some information of a collection in firebase however I can not display this information, I am passing a collection ID and is returning in the log the data I want…
-
0
votes0
answers23
viewsError in Carousel React-Native
Good People, I’m trying to implement Carousel using React-Native-Anchor-Carousel, when I do with still images, I create an array by passing the images and it works 100%, but when fetching these…
-
0
votes0
answers29
viewsProblem with hook in Reacnative
I am starting my studies in Reactnative and I am having difficulties with an exercise I created to train the use of hook useState. I basically created the following component Contador.js: import…
-
0
votes2
answers174
viewsReact JS routes do not work in production
I made a small web system and deployed it in Heroku, it turns out that the routes work normally in development, but in production the routes are not rendered and I have the following error "Cannot…
-
0
votes0
answers97
viewsFiltering Results before rendering, with value returned from an api as a filter parameter
I have a form, which has two related fields, a group and a subgroup, so when I upload the data from the api to popular the screen, I get all the groups and all the subgroups, stored in a state and…
-
0
votes0
answers14
viewsHow to pass to the form the dropdown selection of an API result
I created a form in React that searches for data from an API, and I need that in one of the form fields at the time of registration return the values of a second API (which has ID relation to the…
-
0
votes0
answers38
viewsHow to get the path of the current route of the React-router-dom with the same parameters and just update the route?
I’m developing a dropdown, and each dropdown item will have a link to redirect to the same page, which will change are the parameters on it. I want to know how to get the full URL already with the…
-
0
votes0
answers49
viewsModify SVG with Styled-Components (React/next)
The problem is specific and found nowhere. Summary: How I could modify the properties of my standard JSX SVG icon directly in Styled-Components as well as other icons? Details: I know with…
-
0
votes1
answer49
viewsCheck Image URL before updating State in React/Next
The logic below is: React/Nextjs with Styled-Components. Hello, I have a component that "renders" the banner of a blog (background-image), the url comes from a state that already has a standard…
-
0
votes1
answer62
viewsHow to receive and send data from an React application to a Flask API?
I am making an app in React and would like to use Flask to save user data in a local database. I was able to make React and flask "run on the same door" and thus enable a connection between them.…
-
0
votes0
answers22
viewsDoubts Fetch Nextjs
Good morning, everyone! I went up a site made in Nextjs for Umbler and after that I started having problems with the queries in the Apis. Today I have the following structure Extract Query Screen…
-
0
votes0
answers25
viewsRemove the overlap
I am using the React-Burguer-menu and it is over all the content. I would like to get all the content to the side when opening the menu. Follow code in the Burger import React from "react"; import {…
-
0
votes0
answers15
viewsHow to test an element using Compose?
const enhance = compose( mapStateToProps, withRouter, withApollo ) export default enhance(ManagePublicTable) In the archive Managepublictable.spec.js I’m importing the component as: import {…
-
0
votes1
answer29
viewsImage of some items is not updated when modifying the list order
I’m having trouble keeping my images in the right position. I have a list of images, but when I click on the filter to reverse the order, some images keep their position. For better understanding I…
-
0
votes0
answers39
viewsHow do I force onChange when the page loads?
I need to force onChange when the page loads, but I’m not getting it, I tried jQuery and it didn’t work. Code of the onChange: let gruArrObj = []; let handleChangeSelectGrupoEDT = (value) => {…
-
0
votes0
answers29
viewsIn which situations should I use useRef?
I recently read an article entitled You’re overusing useMemo: Rethinking Hooks memoization. In it, I saw something interesting that I hadn’t thought of before, using the useRef to store object…
-
0
votes1
answer40
viewsProblems consuming api - React
I am consuming an api that returns an array of products with Axios, but it returns a Promise, and I cannot use it in my component, because at the time the component renders, the Promise is still not…
-
0
votes0
answers20
viewsoverflow-y is not working in div after width breakpoint
I’m trying to set overflow-y: auto after a div breakpoint, but it’s not working as I imagined. I have a div-container where has a header, a div wrapper where this has two other (one for a Fields and…
-
0
votes0
answers35
viewsHow do I iterate through Textinput in React Native useRef with typescript
I have a Textinput that will be divided into 4 password entries. What I need is: 1 - Adding a number automatically switches to the next focus entry; 2 - when I delete the entry, I go back to the…
-
0
votes0
answers14
viewsGoogle font not rendering in SVG React
I created the logo of my system in SVG by Illustrator, the logo has 2 fonts google fonts, but to be rendered depends on having the source installed in the OS. I did a lot of research to try to solve…
-
0
votes0
answers37
viewsHow to add items to a list of products coming from an React api
I have a system that I need to search for a product in an api by name, every time I click add I need to pick up the return of the api and include this product a list calculating the total value and…
-
0
votes0
answers41
viewsGenerated apk with zero bytes
Personal talk I’m having trouble generating an apk with React Native. It comes to build the project and run in the simulator, but the app-release.apk file that is generated in the…
-
0
votes2
answers56
viewsAccess-Control-Allow-Origin error with Nodejs and Reactjs application
I’m developing a real-time chat application, using Reactjs on the front end and Node.js on the back end. I have configured the Node server with Socket.io for the application. When entering the chat…
-
0
votes1
answer60
viewsReact - Redux: Typeerror: Cannot read Property 'map' of Undefined
I am trying to render some products coming from my api, however I get this error: Typeerror: Cannot read Property 'map' of Undefined Follow the code of the action: export const listProducts = ()…