Posts by Bruno Nobre • 75 points
19 posts
-
0
votes1
answer28
viewsA: Alert when trying to use Drawer Navigation
The fact is that some React Navigation packages use React Reanimated, such as Drawer and Material Top Tabs. "Reanimated 2 is mainly built on C++ using the infrastructure of Turbo Modules that has…
react-navigationanswered Bruno Nobre 75 -
0
votes1
answer19
viewsA: Insert elements into an Array with Hooks and display in a list
On this line you are calling a function (setElement) specifying a parameter, so you are not passing it by reference: onSubmitEditing={setElement(valorDigitado)} In such cases you must do so:…
react-nativeanswered Bruno Nobre 75 -
0
votes2
answers24
viewsA: Different behavior using useState and useContext/useReducer
After hitting my head all day, I was able to solve by placing an async/await inside the fetchSales method, and inserted the setIsLoading before and after: const fetchSales = async () => { const…
-
-2
votes2
answers24
viewsQ: Different behavior using useState and useContext/useReducer
I have a case that should be very common for you. I make a query of a sales list in a Rest API and at that time I set the status isLoading to true, so that a Spinner component I have is visible and…
-
1
votes0
answers30
viewsQ: Automatically consume data
I’m starting my studies in JS and React-Native. I developed an app that consumes data from a Mysql server that I have hosted on Uolhost, through a REST API that I have deployed as a Firebase…
-
-1
votes2
answers84
viewsA: Strange return even with Async/Await
I found the solution to the problem in https://stackoverflow.com/questions/63798588/reactnative-asyncstorage-returns-weird-values It seems I have to use async/await also in the method call:…
-
-1
votes1
answer28
viewsQ: Alert when trying to use Drawer Navigation
I ask that friends try to do the following. Start an React Native project (here I am using version 0.64.1), install the suggested dependencies for using React Navigation (here I am using version…
react-navigationasked Bruno Nobre 75 -
2
votes1
answer72
viewsQ: How to optimize rendering on functional components in React?
In my studies on React Native I’m bumping into rendering optimization on components, specifically on functional components. It is known that any change in status or props, the default component is…
-
0
votes0
answers37
viewsQ: Doubt about where to declare variable
I have a query on an object that is in a functional component in React Native. I have created a main matrix (arrayholder) to store all data while filter the information in the status variable…
-
-3
votes2
answers84
viewsQ: Strange return even with Async/Await
I have the following functions in common.js import AsyncStorage from '@react-native-async-storage/async-storage' const getData = async () => { try { const jsonValue = await…
-
0
votes1
answer30
viewsQ: Command Destroy in Javascript
I am starting my studies in JS and came across a problem generated by the use of the function. I am using knex and Node.js to connect to a Mysql database. For this I used as an example the tutorial…
-
0
votes0
answers9
viewsQ: Behavior of the Tabnavigator
I created a project in React Native where I return the following Container: const Tab = createBottomTabNavigator() authRouter = () => { return ( <Stack.Navigator initialRouteName={Login}>…
react-nativeasked Bruno Nobre 75 -
0
votes0
answers22
viewsQ: Assignments of values in Javascript
I am starting my studies in JS and I have the following question. Consider the code below: const vazio = null const resultado = vazio || 'Anonimo' console.log(resultado) The console output will be…
javascriptasked Bruno Nobre 75 -
0
votes0
answers42
viewsQ: Doubt about how "import" works
I am learning JS and Reactnative and for that I am studying about the creation of a backend in Node.js and a frontend in React Native and one thing caught my attention. In my backend when the user…
-
-1
votes1
answer39
viewsQ: What is different from Consign’s "include" and "then" methods?
I’m using the Consign library in a back-end creation exercise on Node.js. Part of the code appears like this: consign() .include('./config/passport.js') .then('./config/middlewares.js')…
-
-2
votes1
answer22
viewsQ: Strange behavior
I have a class component where I run a callback (filterTasks) right after a status change (toggleFilter), all normal and trouble-free. export default class TaskList extends Component { state = {…
-
1
votes1
answer68
viewsQ: Calling function via direct or Arrow function
As you know I’m joining this world of Javascript/React Native... In my studies I have noticed in some examples how certain functions are called. Example 1: In this example the onCancel function is…
-
0
votes0
answers29
viewsQ: Problem 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…
-
2
votes3
answers104
viewsQ: Syntactic difference between classes and constructor functions in Javascript?
I’m studying Javascript and I noticed that, in the constructor functions, we can declare variables and constants. For example: function Teste() { const nome = 'Bruno'; this.nomeAtributo = nome; }…