Questions tagged as 'jsx'

2
answers

How to comment code block in JSX (React)

I want to know if it's possible to comment a block of code inside the render () method in React, I've tried all the ways I know and none of them worked. render() { return ( <div className="Events"> <div className="Ev...
asked by 21.11.2016 / 13:43
1
answer

Bug when reorder list of React components

I have a component that loads a list of components <ComponenteReordenavel> that is rearranged according to the user's taste. The bug happens when I modify the style of this component and reorder again, the style always...
asked by 08.12.2016 / 18:54
1
answer

HTML Snippets for JSX

Does anyone know where I can get HTML Snippets to use in JavaScript? Example: input: h1 + tab output: <h1></h1>     
asked by 02.08.2018 / 13:59
1
answer

Repeat audio every time button is clicked - Javascript and HTML

I want the audio to repeat every time the button is pressed. Instead, it only repeats after the audio finishes. (NOTE: I'm using JSX) Javascript playShot() { var audio = document.getElementById('shot'); audio.play(); } HTML <...
asked by 14.02.2018 / 00:41
1
answer

How to change state of complex objects in React?

I have the following object: obj = { title: "obj1", tab: [{ title: "titulo da tab 1", card: [{ title: "card1", url: "url", image: "image" }, { title: "card2", url: "url",...
asked by 13.08.2018 / 21:32
1
answer

Syntax Error. Unexpected token '=' no React

When I try to run dev-server it returns me an error in the console that I can not identify what is generating it webpack.config.js iconst path = require('path'); module.exports = { entry: './src/app.js', output: { path: path.join(__dir...
asked by 28.10.2017 / 18:38
1
answer

Syntax error Adjacent JSX React

I created a component that has six images but when compiling my code I get the following error. AndthisismysourcecodefortheImovelPhotoscomponentimportReactfrom'react';functionImovelPhotos(){return(<divclass="col s12 m3 l3"> <...
asked by 17.05.2018 / 20:54
1
answer

Passing information between components without ReactJS hierarchy

How to pass information between components in React as props or status. In this situation I have a button and a menu. The menu must be opened every time the button is clicked. Button import React, { Component } from 'react'; import './Na...
asked by 21.08.2018 / 12:50
0
answers

Pass value from child to parent in react

I'm having a problem and have tried several ways to solve it ... I need to get the value of the child element and pass it to the parent. Within this form, I have these plus and minus buttons (if there is no shorter than this, it puts an X)....
asked by 17.12.2018 / 19:04
0
answers

Execute a function and it takes more than x seconds of the error - React Native

Good afternoon! I made a function that searches the data of a JSON on the Web, but wanted to wrap it in a function that would take longer than for example 10 seconds to explode an error on the screen, currently the page is only blank, it only...
asked by 20.11.2018 / 19:13