Posts by Carlos Querioz • 348 points
26 posts
-
0
votes1
answer140
viewsA: pass an id into the modal in React
It turns out that when you open the modal, even if you pass to this function of opening the modal the parameter you need, you can’t pass to the function you use for the deleting action. The solution…
-
2
votes1
answer1200
viewsA: How to use the integrated React-select with Unform without typescript?
Typescript adds types for variables, classes and functions. Basically if you take out types it works the same thing in JS. import React, { useRef, useEffect } from 'react'; import { OptionTypeBase }…
-
0
votes1
answer467
viewsA: Route component does not render - React
I had a problem like that once and I don’t really remember much of the problem at the time, but it was related to the Sagas when they needed to change routes. My solution was to use the Connected…
reactanswered Carlos Querioz 348 -
0
votes1
answer52
viewsA: Wrap of an application
Hello. Your question got a little vague, but to do a Wrap is to put the logic or the styles (or anything else) inside a component that will solve all this there. I venture to say that Wrapper is the…
reactanswered Carlos Querioz 348 -
1
votes1
answer152
viewsA: Doubt in error . map is not a Function
Gabriel, what may be happening is that the answer is not coming as an array. See that the console presents a type error, IE, you did not receive an array but something else. You have the option to,…
reactanswered Carlos Querioz 348 -
0
votes1
answer56
viewsA: Help you create a menu component in React
This is Damasio, all right? Inside its map function was missing a Return. Below is an excerpt that can help you. I used the concept of Arrow Function, but left a comment as it would be using…
reactanswered Carlos Querioz 348 -
0
votes2
answers553
viewsA: React Hooks state does not update
See if it works: setProducts([filtered]);
-
0
votes1
answer763
viewsA: onClick={} with div return with API content
It’s John, all right? See, you want to load the data just by clicking on the button, you put componentDidMount calling the API and then it will bring the data like this. I have a suggestion for you:…
-
1
votes2
answers98
viewsA: Select does not let you select the option
Gabriel, I believe you could do it differently using the React api better. I would do the following: Where it has its function handleCompanyChange: import React, { useState, useEffect } from…
-
0
votes1
answer49
viewsA: How to specify only one element in onMouseEnter functions in REACTJS
William, the state is for all components. You need to test otherwise using a component name. I’ll try to reproduce your code with the instructions: import React from "react"; import { NavLink } from…
-
0
votes2
answers700
viewsA: How to pass a touch event via props to a child component?
Fala Hervesson. You didn’t put the code, but I imagine it’s something like this PARENT COMPONENT import React, {Component} from 'react'; import ComponenteFILHO from './ComponenteFILHO'; ... export…
-
2
votes2
answers338
viewsA: Problem with React and Redux
This is Alex, all right? Dude, this kind of change is best done inside the Reset. It would look something like this: Actions import { CLICK_BOTAO, DIGITAR_VALOR } from './types'; // Alterei sua…
-
0
votes1
answer56
viewsA: Import Once Javascript
all right? You didn’t post an excerpt of your code, so I’m going to assume that these two components are separate, of course, and being called by another component, like this: Index ->Comp1…
-
1
votes1
answer579
viewsA: Why use Redux to request the API in React?
Danilo, I usually use Redux when I need to use a query response to the API for more than one component and avoid the props Drill. When the components are fully separated then Redux is an excellent…
-
1
votes2
answers52
viewsA: Doubt Basic variables Javascript
Says Gustavo. You need to put this inside the state. React is reactive, so by changing the state it "reacts" and renders the components again. export default class App extends Component { state = {…
-
0
votes4
answers580
viewsA: Return Asyncstorage value in a constant
Or you can put it in the component DidMount: import React, { Component } from 'react'; import { AsyncStorage } from 'react-native'; ... let user; class sua_class extends Component { async…
-
0
votes1
answer80
viewsA: Using Provider in the Reactjs Context
I used this Context API only once. I did so: In my App.js I instantiated the context like this const INITIAL_STATE = { loading: false, login: localStorage.getItem("tork") ? true : false, error: ""…
-
0
votes2
answers400
viewsA: JWT TOKEN authentication is not persisting
Cassio, this component of yours seems right to me. The question is how you are doing this check on the input component. As if it were so: import React, { Component } from 'react' import {…
-
0
votes2
answers1389
viewsA: How to put the image address in src without it having to be a Component in React
Gabriel, in React these local images need to be imported. You can make a require within the component img or your array. See what’s easier. I made a component here very quickly and it worked, see:…
-
1
votes1
answer900
viewsA: How to Fill in My Fields through My React-Native and (Firebase) Database
Hello! First recommend not to leave data access to your database in Firebase exposed like this. I don’t know much about Firebase, but I believe that the call to the API is asynchronous, so you could…
-
0
votes1
answer254
viewsA: Blocked cross-origin request when creating a box
Possibly your problem is in the backend. Add the library cors. In this case it is a middleware. The configuration is very simple according to the documentation. var express = require('express') var…
-
0
votes1
answer72
viewsA: Error loading localhost
I don’t know if you’ve solved it yet, but sometimes it’s not a problem. Sometimes it takes a long time to download the app pro simulator and then it shows that it was an error, but it hasn’t…
-
1
votes2
answers1102
viewsA: onPress does not call method in React Native
The solution is simple: if creating the function uses the form function function() {} and calling this within it, this is referencing only the scope of the class class, ie it would have to have an…
react-nativeanswered Carlos Querioz 348 -
0
votes1
answer936
viewsA: Animations using React.js
Louie, it is totally possible to use Jquery with React. just install the dependency with npm or Yarn and import it. But I advise you to use both CSS and pure Javascript, since React is a lib that…
reactanswered Carlos Querioz 348 -
1
votes1
answer671
viewsA: Error when compiling REACT
I see that you have created an API component and possibly imported it into the Main file (this is what should be done). But you are not calling the API import on your Main. Something like that:…
-
0
votes2
answers160
viewsA: Error rendering Sectionlist React Native
Marcos, you are trying to set the state before the component is mounted. First start the state with the empty attributes. then create into setState. Type like this: componentDidMout() { const {…