Where to load data in a React/Redux/Routerv4 app?

I am working on an app that functions almost entirely on the following route: /task/:taskId and there is nothing to render at the / route. Instead when you launch the app it should redirect to a task. Much like when you open slack and you are in a ch...
more »

2017-08-14 09:08 (1) Answers

mock a function which is used in another function

I am writing test for my async action in react redux, for sake of addressing just the issue I simplified the code here. Here is my action function: export function updateUserAuthenticationStatus(){ return function(dispatch){ return axios.get(getL...
more »

2017-08-13 20:08 (2) Answers

Radio button not working

I have created a radio component but when clicked it does'nt show checked here is the code import React from 'react'; import classnames from 'classnames'; const RadioButton = (field) => { const inputClasses = classnames('form-group has-feedb...
more »

2017-08-09 15:08 (2) Answers

How to call a function in react-redux

I am new to react-redux. Now I am working on a react-redux project. I want to call a function when my input changes in input tag. For this I apply "onchange" event in this like <input {...this.props} onchange="this.callHandler(this.value)"/&g...
more »

2017-08-03 09:08 (2) Answers

axios.post Fails in App, Works in URL

I'm following a React-Redux tutorial. My axios.post() is failing when running the app, but if I use that same URL and paste it into the browser's address textbox it works. Why would that happen? Here is the call in my app: const request = axios.pos...
more »

2017-07-31 20:07 (1) Answers

How to add an object in reducer?

I have a store that looks like this, 3 objects within an array that carry array. How can I add an object in between the first and second object that carry index 1 and 2? { object: [ { "index": 1, "title": "title", "caption": ...
more »

2017-07-29 20:07 (5) Answers

Calculated field in React?

I'm new to React / Redux, but that's what I plan to use for an upcoming project. Is there an equivelant of KnockoutJs's ComputedObservable? I plan to have an outer component with a master array, and then multiple subcomponents each responsible for di...
more »

2017-07-29 16:07 (1) Answers

React redux waiting for data from api

I am doing register form using react and redux with axios, thunk, and promises middleware. First i want to wait for list of users. Then i want to check that if user with that login and email exist if not post user. I have a problem with waiting for ...
more »

2017-07-28 19:07 (1) Answers

How to skip null while map? JSX

I'm new with ReactJs/Redux and JSX. I have a dynamical table with dynamic information in it. I have problem with map. I have 2 levels of map: <tbody> { data.map(row => ( <tr key={`${row.type}`}> <td> ...
more »

2017-07-28 15:07 (3) Answers

How to deal with relational data in Redux?

The app I'm creating has a lot of entities and relationships (database is relational). To get an idea, there're 25+ entities, with any type of relations between them (one-to-many, many-to-many). The app is React + Redux based. For getting data from ...
more »

2017-07-28 14:07 (2) Answers

Reactjs - Images not displaying

I'm trying to display images in a shopping cart i'm making but its not showing up. Do i have to import each image? I know my paths are fine because it worked before.I think there might be something wrong in my product.js file but I can't figure it ou...
more »

2017-07-26 20:07 (2) Answers

why render function not call in react?

I am trying to show my list in react using component .But it not display .I do like this https://codesandbox.io/s/lYMwLM591 import { Component } from 'react'; class ImageSlider extends Component { constructor(props) { super(props); } ren...
more »

2017-07-21 12:07 (3) Answers