React is a JavaScript library for building user interfaces. It uses a declarative paradigm and aims to be both efficient and flexible.

learn more… | top users | synonyms (1)

0
votes
0answers
8 views

React timer hanging on :00 (state not updating)

I have a basic timer in React functioning properly counting down. The only problem is that it keeps hanging for an extra second (or two) when the timer's seconds reach '00' before switching to '59'. I ...
0
votes
0answers
3 views

How can I get ownProps using reselect on redux?

I want to create a selector with memoization using reselect based on some ownProps of mapStateToProps
0
votes
0answers
3 views

Flux Handling Action State

When i am correct in flux there are 2 different kinds of state Application State (in Stores) View State (in the Component) i am trying to build a CRUD application using flux and don't understand ...
1
vote
0answers
6 views

How to reduce renders using redux + normalizr

I have an app using React + Redux + Normalizr, I would like to know the best practices to reduce the number of renders when something changes on entities. Right if I change just one entity inside the ...
0
votes
1answer
16 views

JS: Access function from enclosing scope?

I'm more used to Python, so the CJS/Browserify stuff might be a red herring; I might be thinking about this wrong. But I'm not sure how to google this. So, I have two JS files for use with ReactJS. ...
0
votes
0answers
7 views

Building an app that can send sms/mms

I am currently using react-native and I want to build an app like imessage that can send sms/mms over the cellular-data networks if Wi-Fi is unavailable. Any suggestion on where to start?on how?
0
votes
0answers
5 views

Meteor + React + Redux + React Router

I have used Meteor with Blaze and Iron Router in the past, however that was a long time ago and I am looking to use the above technologies (Meteor + React + Redux + React Router) to start off a new ...
0
votes
1answer
12 views

WebStorm keeps treating JSX as XML

My WebStorm keeps treating any JSX code as XML which then results in dozens of unwanted inspection errors, see screenshots. Also it keeps saying "Unresolved variable or function" for most of the ...
0
votes
1answer
28 views

Can ReactJS return a div in Bootstrap?

I just started on ReactJS and came across this error Error: Invariant Violation: CarDisplay.render(): A valid ReactComponent must be returned. You may have returned undefined, an array or some ...
0
votes
0answers
5 views

Function Call Not Recorded by Spy After Await

I'm trying to test a flux "action creator" that uses ES7 async / await. With Jest/Jasmine, I have a spy set on a function, and when the spied function is called after the await keyword, the call is ...
0
votes
1answer
21 views

TypeError: Cannot read property 'post' of null"

I just started to use React, and when I was trying to do an Ajax call, I got into some trouble. Im getting: Inline JSX script:29Uncaught TypeError: Cannot read property 'post' of null And I ...
0
votes
0answers
11 views

React Router: Error when sending param (Cannot read property 'userID' of undefined)

I am trying to pass a parameter to a Component using React-Router, but I get TypeError: Cannot read property 'userID' of undefined. Login.jsx (from where the parameter is sent to the Router.jsx) ...
0
votes
1answer
18 views

Testing a component that depends on store from context

I'm having trouble setting up tests for a component that relies on a redux store passed down from context... My app has a root component that gives its children the redux store as context: import ...
0
votes
0answers
20 views

Getting a value of input field in a React component

Just learning React and I have seen various different ways to get a value from a text input. I wanted ask whether all of them are correct or if there are any advantages to using one over another. ...
0
votes
0answers
9 views

User is no longer logged in after redirect with React and Firebase

I am trying to build an application with React and a Firebase server. However, I am having some issues with the authentication part. To be more specific, here is the issue: I am able to successfully ...
0
votes
1answer
27 views

ReactJs - access nested array in JSON response

JSON Response: Bars: [ { id: "7", name: "The Trestle Inn", address: "339 N 11th St", city: "Philadelphia", state: "PA", category: "Dive Bar", checkIn: [ { wait: "0.1", vibe: "0.35", ...
0
votes
0answers
17 views

Set ref if condition is truthy

I have been looking for a clean solution to setting refs if a condition is truthy but haven't seen a good solution yet. I was to do something like the following (sort of pseudo-code): <ul> ...
0
votes
0answers
8 views

Sharing the jsdom document with React with Jest

I'm using jest and testdom (a tiny wrapper around jsdom) to test React components. The problem is I can't even get a very simple test case to pass since I don't think the global document is being used ...
3
votes
1answer
34 views

ReactJS / Javascript conditional statements

I am using arrow keys to move the circle object. Now I want to limit it to the height and witdth of the svg area. My conditional statements partially work as once the ball gets to any of the 'walls' ...
0
votes
1answer
15 views

Unable to get Passport authorization working in conjuction with Webpack dev server

When being served by Express, my React application can be seen at http://localhost:3000/app/. Passport is being used for authentication, and everything is working as it should. I cannot get ...
0
votes
0answers
18 views

react-router - use server-side rendering on first load only

I've recently started playing with React, added react-router, everything is fine. Then I added server-side rendering, but now, whenever I click a link, a request to the server is made. I want to ...
0
votes
2answers
10 views

Webpack Unexpected token SyntaxError

I'm trying to setup a basic web app using react & redux along with webpack. As it stands now I've just put together the basic framework, however running a build always seems to result in the ...
0
votes
1answer
20 views

“if” doesn't work in React's componentWillMount()

I have created a component "App", which has a function componentWillMount defined (it should redirect react router when condition is false). componentWillMount() { const isLoggedIn = ...
0
votes
1answer
56 views

How to pass string with no quotes as a parameter in function?

If my api takes the query as http://localhost:8000/api/v1/rental/?place__startswith=kathmandu then how can i do generic search in reactjs. What i tried is i passed the default parameter as ...
0
votes
1answer
23 views

What's React's “$emit” as in Angular world

In Angular, we could use the $scope.$emit method to notify ancestors. How can we do the same thing in React?
1
vote
0answers
15 views

Meteor build breaking on deployment to Heroku

I didn't change any dependencies but suddenly my build is breaking when I deploy to Heroku. See error message below for more information. -----> Fetching set buildpack ...
0
votes
0answers
54 views

Access a array that contains object

I try to access data from a prop Like this.props.teachers it retrieves me Object {} on console and when I try this.props.teachers[0] returns undefined and this.props.teachers[0].age retrieves an ...
0
votes
0answers
12 views

Rails Browserify React ExecJS error during precompile

I've tried out literally all the solutions that are available out there. But I'm stuck with this for the past 24 hours. I am not able to track where the error is. Here's the error log which I got ...
0
votes
1answer
18 views

React Native: Refs in ListView

It looks like the refs of views in is hard to be directly accessed. Now I have a list view with a cells. In the renderRow function I have something like: renderRowView: function(rowData){ return ...
-1
votes
1answer
14 views

How to handle url param changes in react-router?

I have initial url /processes/new After making changes i want to save it & navigate to /processes/_generatedprocessID_ So i subscribe to routerWillLeave and hope it will fire on url param ...
0
votes
2answers
31 views

Getting undefined when trying to pass data between component

First of all I am new in React. I have two components TagUtils and Urls. I am trying to pass router paramter from Urls to TagUtils. Here is my codes: Urls.jsx // some codes.... export default class ...
0
votes
0answers
15 views

How do I apply a Font Theme in React Material-UI?

I'm trying to apply a google font to my Material-UI react project, but can't seem to get it to take. I'm using mui 0.14.2. My index.html font load: <link ...
0
votes
1answer
18 views

React Redux adding items to list carries over to other created lists.

I've been battling with this for too long, can someone point me to the right direction? The issue: When i create a list I am able to update/delete it. I am also able to add items to it and ...
0
votes
0answers
20 views

TextInput with React Native displays a single line

I'm trying to implement two text inputs. I'm not sure if the best practice is to wrap these inside a scroll view or not. However, when I do it as shown below, I just see a single line in the middle. ...
0
votes
2answers
24 views

immutablejs turning object after dispatch

I'm building a simple react/flux application using the store from flux/utils and, of course, Immutablejs. When the application boot initially the state retrieved from store is an Immutable.map but ...
0
votes
2answers
14 views

React Native: Change Component (Text) on Navigator Pop

I'm creating a Component/View that has a list of things to select from similar to a table view. When I'm in View A I can jump to this table view by doing a navigator push. Once an item is selected I ...
0
votes
2answers
11 views

Displaying Multiple Properties of a component in React

I'm a beginner, learning React using this tutorial as a guide > http://survivejs.com/webpack_react/implementing_notes/ I'm having trouble understanding and figuring out how to make a shopping list ...
0
votes
1answer
29 views

Re-render child component in React or change child state

For example, we have a component (this is a child): class Child extends React.Component { constructor(props) { super(props); this.state = {show: props.show || false}; ...
0
votes
2answers
20 views

Target DIV inside table with hover

have a regular table, which looks like this. <table> <thead></thead> <tbody> <tr> <td> <div ...
0
votes
1answer
25 views

Roles with Meteor and React

I am currently working on a project for a client. I'm trying to assign roles to users at the time they sign up for an account. handleSubmit(e){ e.preventDefault(); ...
0
votes
0answers
18 views

Any react widget library available which is build using typescript?

I am trying to build a reusable widget library to be used across different modules within a large enterprise application. Are there any seed projects available that I can refer? Any pointers would be ...
0
votes
0answers
18 views

Meteor + React Tutorial not working

I have Windows 8.1 64bit. I'm trying to learn meteor and react and tried tutorial offered by meteor. I had some troubles because meteor 1.3 and windows 8 didn't like each other a lot but I managed to ...
0
votes
1answer
18 views

How to declare class properties defaultProps?

Show by example how to ReactJS, in TypeScript to declare a class property defaultProps? interface IProps {} interface IStates {} class SomeComponent extends Component<IProps, IStates> { ...
0
votes
1answer
28 views

Reactjs - value undefined

First of all, I suspect that const vector object is probably in a wrong place but I don't know where to put it. I'm trying to control the position of the SVG object with arrow keys. It does not seem ...
0
votes
1answer
21 views

React+Redux - Uncaught Error: Expected the reducer to be a function

I tried simple react,redux,ajax working example and followed Reddit API tutorial, but I cannot create store and get error: Uncaught Error: Expected the reducer to be a function. index.jsx ... ...
1
vote
2answers
20 views

How to use whiteSpace: 'pre-wrap' on React

How can I use the style whiteSpace: 'pre-wrap' on React I have a div that need to render the text using the format with spaces render() { <div style={{whiteSpace: 'pre-wrap'}} keep ...
0
votes
0answers
13 views

How to implement a ReaBy feature on a chat?

How can I implement a feature of 'readBy' in chat Messages?, like the chat apps that notifies you when the other person sees the messages, I mean, how can I know in a webApp using javascript that ...
0
votes
0answers
12 views

Server rendering with react-rails 1.6.2 and ExecJS

I recently upgraded react-rails from version 1.0 to the latest build 1.6.2 and a few things broke. I've been able to fix most of it (namely the server-rendering bug when assets are precompiled using ...
0
votes
0answers
17 views

React.jsx problems with Browserify

var _carouselListJsx = require('./carouselList.jsx'); var _reactRedux = require('react-redux'); var CarouselOuter = (function(_React$Component) { _inherits(CarouselOuter, _React$Component); ...
0
votes
0answers
22 views

Deep pick all nested data props

I am sending this data to my action for an api post. Is there a way I can use lodash to grab all the props and put them into the top level? rangeStartYear:12 Id:3647074, updatedElements:{ ...