Posts by nbkhope • 1,360 points
49 posts
-
-1
votes1
answer25
viewsA: this.state.value returning Undefined when it is changed
There is no Event.target.XXX properties that you wrote. For your case, just make handleChange a function that returns another function. The property name can be passed as the argument for the…
-
4
votes1
answer4411
viewsA: What is the difference between Function and Class in React?
It seems to me that your question is not specific to React, but in general to the Javascript language. Anyway, I will explain the two cases. (1) In the case of own language Before the Ecmascript…
-
2
votes2
answers3949
viewsA: How to change the style of an React component by clicking a button?
Here I comment on three ways to define the style. (1) Traditional way Create an individual file for the style sheet that will be used throughout the app. Problem: It may be that not all styles are…
-
1
votes2
answers640
viewsA: State Global using reactjs
In pure React you pass the information from father to son via props. Then its variable that keeps the state of the div must be defined in an outside container component that contains both the…
-
1
votes3
answers6521
viewsA: Can you map() an object array to React?
The error occurs because there is nothing being returned from the method render(). This is clear from the code and the error message. Here is my suggestion to solve the problem: divide the user…
-
0
votes1
answer168
viewsA: Custom style for React ui material
Important: createStyleSheet() was removed in version 1.0.0-beta.5 Your problem is that you are not calling the function with the arguments correctly. Looking at the version 1.0.0-beta.4 code,…
-
0
votes1
answer333
viewsA: REST API endpoint standard
In the frontend, you will make HTTP requests to get the necessary information for the user interface. It does not matter how the method of obtaining the information is implemented in the backend.…
-
2
votes1
answer2759
viewsA: How to close Node.js in the application?
There are two ways through the object process: (1) process.abort() (2) process.exit(codigoDeSaida) The first aborts the program on time, usually for abnormal things. The second commands the Node to…
-
1
votes1
answer724
viewsA: How to know if constant has a value?
Just check how Voce is doing. But Voce should not use setState() in the way render() -- this same should only have the role of model for sight, nothing more. Then Voce must show a pro user interface…
react-nativeanswered nbkhope 1,360 -
1
votes3
answers1171
viewsA: Convert string to number
Convert a string for number in React Native is the same problem to do this in Javascript, which is the language used by the framework. So just use the parseFloat(): parseFloat("123.45") // =>…
react-nativeanswered nbkhope 1,360 -
0
votes2
answers1756
viewsA: How can I automatically execute a script when creating a container?
To be able to run any command after the container is created simply add it after the image name: docker container run nome-da-imagem comando-aqui You can also add more options to the above command.…
-
2
votes1
answer53
viewsQ: Why does logback use both logback-test.xml and logback.xml as configuration file name?
Reading the logback manual on configuration section, he says he looks for the following configuration files, in order: logback-test.xml logback.groovy logback.xml Why there is a suffix -test? For…
-
0
votes1
answer129
viewsA: Error in Muithemeprovider
The error you mentioned clearly speaks to the problem: you are not providing the prop Theme, required by the component MuiThemeProvider. Just out of curiosity, you can look at the component source…
-
1
votes2
answers1259
viewsA: Unexpected token - React
You are using a stateless functional component ("Stateless Functional Component"), defined thus: function MeuComponente(props) { return ( {/* Template aqui */} ); } This component doesn’t maintain…
-
1
votes1
answer118
viewsQ: How to reverse the $unwind operation on Mongodb 3.4?
Imagine a collection of products: db.produtos.find() [ { _id: "produto01", cores: ["preto", "branco", "ouro"] }, { _id: "produto02", cores: ["branco", "ouro"] } ] Each product has a field called…
-
1
votes1
answer195
viewsQ: How to configure Docker Compose with equivalent to -d option (detach)
The following command runs a container with mysql in the background. docker run -d -p 3306:3306 -e MYSQL_RANDOM_ROOT_PASSWORD=yes --name mysqldb mysql The equivalent with the docker-compose.yml…
docker-composeasked nbkhope 1,360 -
0
votes1
answer190
viewsA: Java with Mysql (JDBC) - Type YEAR
Your getter method getAno() returns a primitive type "short," which is different from the Short type of the java.sql.Short. You should use java.sql.Short, which is the type used by the driver.…
-
1
votes1
answer345
viewsA: Code reuse in React
One way is to create your own component for the Menu: class MeuMenu extends Component { onMenuItemSelected = item =>{ if(item == "inicial") { Actions.inicial(); } else if(item == "agendamento") {…
-
2
votes1
answer8201
viewsA: Error React-Native run-android
Before turning the remote react-native run-android, you need to have the Android emulator running with AVD (Android Video Device). One of the ways to run the emulator is to open the project in…
-
0
votes3
answers6131
viewsA: How to Save Data with Asyncstorage
Your button when played will only perform the function saveData(), which saves data on AsyncStorage. In order to read the data, you need some guy to call the displayData(). The Try/catch code will…
-
1
votes2
answers990
viewsA: I can’t change the default React app
How did Voce generate the project? Using create-react-native-app or directly with react-native init? a) Projects generated with the create-react-native-app run straight from the file App.js without…
-
0
votes1
answer170
viewsA: Problem with installation of the Reactnative-FBSDK package (Authentication via Facebook)
According to the documentation, the installation method of the package is thus, within the folder of the new project: react-native install react-native-fbsdk react-native link react-native-fbsdk…
react-nativeanswered nbkhope 1,360 -
1
votes1
answer320
views -
1
votes1
answer270
viewsA: I can’t edit Input content that returns address
Duplicate of Open field with value set, but can be edited Add the prop onChangeText to Input to update the state of the component with a new value to place. <Input onChangeText={(text) =>…
-
1
votes1
answer731
viewsA: Open field with value set, but can be edited
When the render method is called, the input value comes from the state this.state.place. The input will only change text if the state is changed. Then you have to use prop onChangeText={(text) =>…
react-nativeanswered nbkhope 1,360 -
1
votes1
answer1455
viewsA: How can I check the text size of an React-Native input?
(1) Where is the text stored? In the state of a component? If applicable, just check this.state.seuTexto.length. (2) When do you need to check? In the way you type or when you click a button? (2.1)…
-
2
votes1
answer50
viewsQ: How to make a Docker image of a Node app that uses a private file that requires ssh
Following this guide from the Node.js website to create a Docker image for a Node application, everything works except when you have a private repository for a certain npm package, such as the…
-
2
votes2
answers77
viewsA: React Redux initState
The Redux status of the application ("application status") stores information required for the use of the application. The initial state is determined for convenience and to detail which properties…
-
11
votes3
answers5190
views -
0
votes1
answer113
viewsA: webpack localhost/sockjs.js.map not found
If by latest version of webpack means v2 or v3, your module format is wrong. Now it is used module.rules instead of module.loaders. That’s how it is now: module: { rules: [{ test: /.js?$/, exclude:…
-
0
votes1
answer66
viewsA: Webpack Reactjs
Hi, for webpack version 2 and 3, module.loaders has changed to the following format: module: { rules: [ { test: /\.js$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { presets:…
-
0
votes1
answer70
viewsQ: Good practice passing arguments to a method when they come from another function
I came across a code similar to the following: private fazerAlgo(AlgumaCoisa algumaCoisa) { Utilidades.converter( formatador.formatarParaTal( algumaCoisa.a, algumaCoisa.b, algumaCoisa.c ) ) } At…
-
7
votes3
answers4443
viewsA: What are the main differences between Angular, React and Vue.js?
Angularjs (version 1) is already obsolete. It is a framework that includes routing, form validation, etc. It uses MVC (Model-View-Controller) template. Its successor is Angular, which is already in…
-
1
votes2
answers781
viewsA: Slow reaction when opening graphical dependencies
As Sergio’s reply said, if Yarn error appeared, then you have to make sure that the same was installed. And what is "Reacty"?? How did you install React Native? Using npm? If you follow the official…
-
4
votes2
answers1866
viewsA: What’s the hell with callbacks?
Instead of callbacks, you can use promises ("Promise"). Nowadays you can already use Precedents with almost everything. They were created to relieve the callback Hell. For example, you make an HTTP…
-
0
votes4
answers48238
viewsA: How to convert a String to Int in Javascript?
You can also convert a String to Integer Number like this: ~~"123.213" // => 123
-
0
votes2
answers206
viewsA: Select from an array inside another array
I didn’t quite understand the question, but you can easily access the elements of Arraylist like this: def lista = [['a', 'b'], ['d', 'e'], ['c']] lista[0] // Primeiro elemento da lista: primeira…
-
0
votes6
answers201
views -
46
votes3
answers83000
viewsA: Format currency with mile separator
You can use the function toLocaleString(), which is part of the prototype of Number. For example, to convert 124231.45 and 1242311234.45 to the Brazilian standard, use respectively:…
javascriptanswered nbkhope 1,360 -
2
votes3
answers1163
viewsA: How to get the id of the onclick that was executed
You can also use the event variable this way: HTML <button id="meu-botao">Clica</button> Javascript var meuBotao = document.getElementById('meu-botao');…
javascriptanswered nbkhope 1,360 -
0
votes2
answers661
viewsA: Database - Sqlite
How about taking a look at this page about the Asyncstorage API? https://facebook.github.io/react-native/docs/asyncstorage.html You can use Asyncstorage to store data in key-value pairs. According…
-
1
votes1
answer104
viewsA: Reactjs + Angular + Babel
Why not include the Babel script like this (after including React and React-dom): <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.34/browser.min.js"></script> And…
-
1
votes1
answer342
viewsA: React Native - Listview
I agree that you should put the Components in full. Just what you have now here does not give us to know what is happening. Check the existence of the render() function of each Component, because it…
-
0
votes2
answers155
viewsA: Rails performing XHR request when loading pages
Ruby on Rails is a framework for the backend and is therefore not a single-page application framework (for frontend) like Angularjs and React. When you require a server route (request), it sends a…
-
0
votes1
answer80
viewsA: App quiz Angularjs does not appear when the page is online
It makes no difference if you’re using CDN. The first question is: does your app work locally? The second question is: what kind of server? If it’s something like Heroku, you have to have a frontend…
-
2
votes1
answer99
viewsA: What is the name and differences between the following ways of working with Javascript objects
There are two ways to use Javascript objects: with Object Literal using key-value pairs ("key-value pairs"); or using a function that will be the object constructor. Object Literal: in this mode of…
javascriptanswered nbkhope 1,360 -
1
votes3
answers8785
viewsA: How to pass an Object to another page using Angularjs?
By "another page," you refer to another external site or other view within the Single-Page Application itself served by Angularjs? If you go inside Angular, you can create a service to request…
-
0
votes2
answers286
viewsA: Javascript for the Angular
Normally, you set the starting values for your form in the controller. This way you will have an initial value defined when the application starts. Look at this example I wrote:…
-
0
votes2
answers75
viewsA: What is the best way to create a model q has a field that is an integer Enum?
You can use a Boolean for values true or false. status:boolean