How to access a key value in State in a function?

I'm trying to make a counter that adds up a total amount for items added to a webcart. I initialize this count within my this.state constructor. However, I'm having problems pushing a count total to it from a function within the same component. This

Relay Modern: Websocket connection to the network layer

I'm having issues figuring out how to connect the Relay Modern network layer with my websocket instance. I'm currently instantiating a websocket instance as: const subscriptionWebSocket = new ReconnectingWebSocket('ws://url.url/ws/subscriptions/', nu

Wrap multiple HTML strings in React mode

I'm building an entity highlighter so I can upload a text file, view the contents on the screen, then highlight words that are in an array. This is array is populated by the user when they manually highlight a selection e.g... const entities = ['John

Trying to change the imr src of a table on click using react

Im trying to change the img src getting the src from and array based on the direction of arrow that is clicked in react.js. So for example I have an array when a user clicks on the right arrow it will change the img src forward and if she clicks back

Use Immutable.js without Flux or Redux

I've been messing around with some code and I think I just realized something stupid. Using Immutable.js in React without Flux or Redux is a fool's errand. toggleTask(task) { const found = _.find(this.state.taskList, task => task.name === task); foun

Props.store does not work on child components

please help. this.props.store does not work on child components. but the connect(mapStateToProps, mapDispatchToProps) ... is working fine. why doesn't work only child components? 1. parent code (is working fine) import React from 'react'; import Reac

Can not read the 'map' property of undefined in React

I have the following component which is being called from a container component. The container component passes the transactions prop. I know that the data property in prop is being passed in fine and has data and can be accessed from the console.log

Transforming localStorage entries into a table

I am creating a React application that you write in a recipe name and ingredients, and they will appear as a list on the page for each recipe created. I was going to use .map to create the list items, but I need an array to work with that and the loc

How to test Async storage with Jest?

I'm building an app with React Native. I want to minimize how often I communicate to the database, so I make heavy use of AsyncStorage. There's a lot of room for bugs in the translation between DB and AsyncStorage though. Therefore, I want to make su

Calling a function in an arrow function does not work

I am trying to call a function inside an arrow function but somehow it doesn't work. What am I doing wrong? This doesn't work: restartVideo(ref){ ref.player.seek(0) } onProgress={() => {this.state.restart ? this.restartVideo : null}} This does: onPro

Hiding a component with React

I have a couple of react classes in my code. When the app fires up, the user is presented with this: <div> <h1 className="headings" id="heading"> Football </h1> <input type="text" placeholder="name&q

Ssr stream router, meteor and hardware ui

Im using meteor 1.4 and material ui with react and im getting this error warning.js:36 Warning: React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup gener

The function is not calledChange check box

I am repeating a OBJECT to render UI. Each row has a ItemName and a checkbox. Onclick of checkbox I should get the ID of that row. When I Run the page I am getting this error msg => Cannot read property 'addToCompare' of undefined import React from '

ReactJS - Manage parent event in child event handler

I have a react container where I want to capture mousemove events. That is pretty straight forward. Further I have a react sub-component rendered by the container where actually the logic for the mousemove event handler resides. So I need to pass/del

Recover POST Unexpected end of input error

I'm trying to do a POST request for authentication in Redux and I'm passing email & password as the body but it returns this error in the console: Uncaught (in promise) SyntaxError: Unexpected end of input I looked around for the answer and many peop

react to the redux synchronous call

Building a React application with redux as the flux pattern. To use an api a token exchange request needs to happen. This has to occur only once when the React application starts. The access_token returned from the token exchange needs to be stored i

JavaScript / React Style guide indentation

Is there an agreed-upon convention for indentation in React JSX? 2 spaces, 4 tabs, etc.You should just use the same indentation as the rest of your javascript code. That said react ecosystem seems to use mostly double spaces so I'd use that for consi

GraphQLList and react

I am new to graphql and relay, but i do all the things alright. I try to fetch my site properties list (new GraphQLList(Property)) using graphql query and there is no problem here, all properties fetched but the props.properties in my react component

Detect React Router Transition in ES6 Class

I'm trying to detect a route change caused by clicking on a <Link>, so that I can change the state of my component when the route changes. I've seen a lot of places suggest that you can use router.addTransitionHook, but I have a couple problems with

React.js creates a loop through Array

I'm trying to display a Table of 10 Players. I get the data from via ajax and pass it as props to my Child. var CurrentGame = React.createClass({ // get game info loadGameData: function() { $.ajax({ url: '/example.json', dataType: 'json', success: fu

What is the difference between state and accessories in React?

I was watching a Pluralsight course on React and the instructor stated that props should not be changed. I'm now reading an article (uberVU/react-guide) on props vs. state and it says Both props and state changes trigger a render update. Later in the

Incorporation of SVG into ReactJS

Is is possible to embed SVG markup into a ReactJS component? render: function() { return ( <span> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmln ... </span> ); } Results in the error: N