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
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
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
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
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
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
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
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
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
I have these two components that are completely independent of each other. I want to render App when I enter / and render About when I go to /#/about I got this piece of code (but I tested quite a few others): import React from 'react'; import ReactD
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
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
This question already has an answer here: Unable to access React instance (this) inside event handler 11 answers I have refactored a component and i am not using React.createClass in class methods anymore but i have this error now {this.props.removeC
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
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 '
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
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
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
I create a custom select component and when I update the options from a parent the render method does not re-render my options on the select element. Below is my code: The select component: render(){ return( <select type='select' multiple={this.props
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
Why does the following assertion work: interface AllRequired { a: string; b: string; } let all = {a: "foo"} as AllRequired; // No error But this assertion gives an error: interface SomeOptional { a?: string; b: string; } let some = {a: "foo
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
I'm having some problem to get height of a dynamic created div. This div does not have css height property defined. I'm using React JS. I tried use jQuery, pure javascript and React tools to get DOM Node, but the result is always 0. If i try $(....).
Is there a way to tell which component generated a specific DOM node?, e.g. <CustomDiv>a</CustomDiv> <div>b</div> <div>c</div> CustomDiv is a just a wrapper that generates <div /> element. In DOM, these are repres
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
I am using Redux as a Flux alternative and React for the view layer. My application's React and Redux are bound with react-redux connect() method. When running the application it dispatches the action when the components mounts and the redux returns
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
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
This is the error when, through command-line, I do gulp scripts: TypeError: Object #< Transform > has no method 'transform' This is gulpfile.js: var gulp = require ('gulp') , browserify = require ('gulp-browserify') , source = require ('vinyl-source
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