Data dodania Pytanie
2018-02-07 22:02 How to pass a class extending React.Component as a property to render it (using babel)? »
This issue is only reproducable in babel (using babel-runtime-6.26.0). Having the following structure class Foo extends React.Component { // ... } ...
(2) odpowiedzi
2018-01-24 05:01 Installing Babel to use with React and JSX »
I'm new to React and Babel and JSX. I'm trying to figure out how to install Babel so it will "do the right thing" with React and JSX in the browser. ...
(2) odpowiedzi
2018-01-17 21:01 Why can't I use a ternary operator and arrow function in this way in JSX? »
With babel-preset-react (EDIT: babel version: v6.26.0), the following expression fails with the error "Invalid left-hand side in arrow function parame...
(3) odpowiedzi
2018-01-06 23:01 How can I combine a React element and text inside a ternary? »
Normally if you have something like: <SomeComponent foo={bar} /> you can make it optional by using a ternary: {bar ? <SomeComponent foo={...
(2) odpowiedzi
2017-12-23 15:12 ReactJS acting weird when rendering component »
I've weird issue when using map() function when using it with ReactJS. I have array of 3 objects hardcoded into my App state and when i try to iterate...
(1) odpowiedzi
2017-12-14 15:12 HTML tags to JSX React Native »
I'm doing a call to an API that returns some HTML: example: <p>Hello there</p><p>Javascripti</p> I want to use this in my ...
(2) odpowiedzi
2017-11-05 22:11 My inputs start with weird values »
I've created very simple form for user to sign in. Here is my code: import React,{ Component } from 'react'; class SignIn extends Component { cons...
(1) odpowiedzi
2017-11-05 18:11 Set Heading Level With Props React »
Just wondering if there is anyway to set heading levels by passing props down to the base component. Example: Base Component class Heading extends ...
(1) odpowiedzi
2017-10-09 11:10 Return react 16 array elements in typescript »
I want to use the new react 16 feature to return array elements in my render but i'm getting the typescript error Property 'type' is missing in type '...
(1) odpowiedzi
2017-09-08 12:09 Error during conversion of a string to JSON object in ReactJS application »
As part of my ongoing effort to learn ReactJS I'm developing a simple page that will render a list of trends as follows: On clicking the button "Ge...
(5) odpowiedzi
2017-09-03 22:09 What is wrong with my custom authentication react-router route? »
Unfortunately I fail to create a custom route with react-router version 4. I'm trying to construct a route which renders a component, if the user is a...
(2) odpowiedzi
2017-08-28 21:08 Trouble Loading Method in React Component »
React NOOB issue I'm having: I have a JSX file that uses Axios to make an API call: fetch-api-data.jsx: import * as axios from 'axios'; expo...
(2) odpowiedzi
2017-08-11 11:08 Why isn't JSX saved as a const rendering »
I am fairly new to React & JSX however I was under the impression that you can save JSX as pretty much anything (var,const, let...). However when...
(4) odpowiedzi
2017-08-08 15:08 Why can't I use "this" in a JSX rendered html element? »
My question is about conditionally rendering in JSX & the use of this. Consider the following code in my React application: render() { retur...
(5) odpowiedzi
2017-08-06 03:08 Put a conditional statement in my JSX »
<li className=`nav-item {(this.props.activteState===1) ? "active":""}`><a href="#">Main</a></li> ^ This is my code. I want t...
(1) odpowiedzi
2017-07-27 18:07 Create an extensible architecture with React »
My team is creating the administration panel of a CMS using React, Typescript, TSX and Webpack. Each page of the administration panel has been created...
(0) odpowiedzi
2017-06-20 16:06 What is ACTUALLY the right way to transition/redirect using React Router? »
I'm in the process of learning React Router, and I can't seem to figure out what is currently the recommended way to redirect. I've read many articles...
(3) odpowiedzi
2017-06-17 13:06 how can i use if inline react jsx »
I wanna use 'if' in react router for check user is login but i don't know about correct syntax: const RouteWithSubRoutes = (route) => ( <Rout...
(2) odpowiedzi
2017-06-12 07:06 React is rendering [object object] rather than the JSX »
I'm trying to render out journal entries on my site with an object (not array) and I am running into an issue, here is my current code populateJou...
(4) odpowiedzi
2017-06-05 07:06 Which are best option(s) to append many props to child component? »
Using react 15.5.4 I have a component already configured to cross props in its child. export default class Component extends React.Component { re...
(1) odpowiedzi
2017-05-18 10:05 Undocumented method of passing element children: as attributes instead of explicit children »
I have encountered some example JSX code in a book which took me by surprise - it contains an anchor tag in the single (non-closed) form. I have simpl...
(1) odpowiedzi
2017-05-16 21:05 ReactJS trying to call setState from onClick function and getting: Cannot update during an existing state transition error »
Inside my render return() I have these: <button onClick={ this.selectTimeframe('Today') } className={ this.setActiveIf('Today') } type="bu...
(2) odpowiedzi
2017-05-09 18:05 Why can't I have a JSX comment inside an element tag? »
I'm following the common pattern of breaking multi-attribute tags on to multiple lines, eg. <div className="foo" style={{ fontWeight: "bold" }...
(2) odpowiedzi
2017-04-22 09:04 Can class object be called from React Component Prop? »
I'm studying ReactNative.Navigator.renderScene props. 'use strict'; import React,{Component} from 'react'; import ReactNative from 'react-native'; co...
(1) odpowiedzi
2017-02-12 18:02 is it possible to mix react jsx with non jsx components? »
So the question I have right now is if I have a parent component that is JSX but I have the need to include an html tag such as <i class="fa fa-win...
(2) odpowiedzi
2017-02-07 16:02 React component with function »
I have a react class with some div and I want to add some extra HTML from a function. When I run this I get an error saying that OverlayButton is not...
(2) odpowiedzi
2017-02-03 23:02 Can I call HOC directly from within JSX / TSX in React? »
I have a React HOC in TypeScript, but it doesn't seem to work when I call it from within a TSX Component render method. Here's an example: export cl...
(2) odpowiedzi
2017-01-29 18:01 React Router and route params »
I've had a browse and I couldn't find anything solving this for me. I've got a problem with a routing requirement that I've got within my SPA. There i...
(1) odpowiedzi
2017-01-14 20:01 Why one function requires binding and the other doesn't? »
I just started learning React and JavaScript. While going through the tutorial, I got to this example code of a component, which creates a toggle butt...
(2) odpowiedzi
2016-12-25 16:12 How can I pass component object to container in React.js? »
My goal is to reuse modal from bootstrap in multiple components. I have a question how can I pass a component to container? <ModalContainer ...
(3) odpowiedzi
2016-12-20 18:12 Stateless component: A valid React element (or null) must be returned »
I'm new to ReactJS. I'm trying to display Hello world using the code below, but I get this error message: What am I missing? Code for App.js /...
(1) odpowiedzi
2016-12-05 18:12 Cannot read property 'state' of null »
I have an input and a button <input className="form-control" value={this.state.sentence} onChange={this.onChange}/> <button type="button" on...
(2) odpowiedzi
2016-11-21 22:11 Validate propTypes on parent and child components? »
Should I be adding propTypes to parent components and their child components? For example I have a <Header modal={this.state.modal} lives={this.st...
(2) odpowiedzi
2016-11-20 07:11 Reference Error: Can't find variable process (http 10.0.2.2:8081) - how do I stop this? »
I'm having trouble building my react-native project. When I try to build it - I get this error: referenceerror can't find variable process http 10.0.2...
(0) odpowiedzi
2016-11-04 10:11 How to make react available on whole app without importing it again and again in every jsx file »
How to make react available on the whole app without importing it again and again in every jsx file using webpack ...
(1) odpowiedzi