Questions tagged as 'reactjs'

1
answer

How to send a form to my REST APi in React?

Good afternoon, I have this form in my render <form className="form-horizontal" role="form"> <p><input type="text" className="form-control" id="name" placeholder="Name" required/><...
asked by 13.01.2017 / 19:42
2
answers

Problems compiling a component in react.js

I'm trying to build a component that receives parameters. This component is called when, you press a news item on a main page. The only parameter that happened manually is the property slug . The component I have defined it this way:...
asked by 11.07.2018 / 23:45
1
answer

React For Loop with onClick inside

I am working with React, I have the following code: var rows = []; for(var i = 1; i <= this.state.numberOfPages; i++) { rows.push(<li key={i.toString()} onClick={() => this.getResults(i)}><a href="#">{i}</a></li&...
asked by 26.12.2016 / 20:59
3
answers

My Router does not work with webpack2

Passing my code to ES6 using webpack2 gives me this error: Warning: React.createElement: type is invalid - expected to string (for built-in components) or a class / function (for composite components) but got: undefined. You likely forgot to...
asked by 23.02.2017 / 15:04
1
answer

Upload backend and frontend together in heroku

I want to upload an application with backend in nodejs and frontend in react without creating 2 projects in heroku. The directories of my application are like this: My Application app - "This folder contains the frontend created with...
asked by 05.12.2018 / 03:50
1
answer

I can not show images with reactjs

in app.js I want to show an image. import React, { Component } from 'react'; import './App.css'; import Image from './components/Image'; import Input from './components/Image'; class App extends Component { render() { return ( &l...
asked by 09.09.2018 / 11:30
2
answers

Problems with handling state and props in React JS

Hi, I'm venturing into React Js and I'm looking at how props and state behave. I'm passing some props through the ReactDom and I try to manage them and I see that they do not change their initial state. Now I'm working with the states and I see...
asked by 27.02.2018 / 17:13
1
answer

Example of project with create-react-app react-router-dom and expressjs

I have a project with create-react-app where I do all project routes with react-router-dom (since the examples with react-router are no longer updated). I need to use data from a DB in MSSQL and I am using superagent to fetch the data using url...
asked by 03.11.2017 / 22:47
2
answers

Uncaught (in promise) SyntaxError: Unexpected token in JSON at position 0

Good afternoon, I've been trying to find the problem for a whole day and I could not get the following error:    Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 I have searched in other forums but some recom...
asked by 07.02.2017 / 23:09
1
answer

What would be the optimal way to do this?

onInputChange (e) { this.setState({ username: e.target.value }); } onInputChange2 (e) { this.setState({ email: e.target.value }); } onInputChange3 (e) { this.setState({ password: e.target.value }); } Inputs &...
asked by 13.01.2017 / 22:18