Posts by Luan Vinicius • 61 points
7 posts
-
0
votes1
answer45
viewsA: By clicking on a checkbox the next component appears
Fala Yuri! You can maintain a state that represents the open object/component by referencing a unique value of each object (in your case it would be the position). When you check a checkbox, you set…
-
0
votes1
answer34
viewsA: How to insert a web snippet into a React js application
You can put this on index.html or put this function into a file (by good practice) and import it into the base of the React app (the file in which you use the ReactDOM.render)…
-
0
votes1
answer58
viewsA: Error while trying to render ternary conditional operator component in REACT
Opa João, good morning! Are you forgetting to return something from .map. Your code should stay that way: {portaisAtuais .filter(portal => !portais.includes(portal.id)) .map((portal, index) =>…
-
1
votes2
answers835
viewsA: Using API in React JS
You have a rejection of CORS. Check the request and response headers and see if your server. The header Access-Control-Allow-Origin is very important when it comes to script requests, as MDN says:…
-
0
votes1
answer155
viewsA: Change a Component Class React to a hook useState React-Native
import React, { useState } from 'react'; export default function App (props) { this.state = { selectedStartDate: null, selectedEndDate: null, }; const…
-
0
votes2
answers73
viewsA: Add paragraph with jQuery
Opa Eduardo! I adapted your script to use Jquery at the time you get the input value $("#btAdd").click(addText) function addText () { const text = "<p>"+$("#t").val()+"</p";…
-
1
votes2
answers511
viewsA: Using React, Typescript and Nodejs. Sending form for JSON user registration. I only know how to use Formdata. How to pass the elements as JSON?
Opa Andre! To send a json, you must put the Header Content-type as 'application/json' and the body you send in a string format. In his example, data will be a simple object, and in your api.post…