Load a css class on hover

I have a div and when i hover that div i want to call another css class. I have used some ways i've found but i cannot get it to work. html code <div className="trait_box polaroid"> <div className="trait_description_div">...
more »

2017-03-17 05:03 (6) Answers

Wrong components rendered by Preact

I'm using Preact (for all intents and purposes, React) to render a list of items, saved in a state array. Each item has a remove button next to it. My problem is: when the button is clicked, the proper item is removed (I verified this several time), ...
more »

2017-03-13 22:03 (1) Answers

Ensuring my React Redux app is SEO friendly

When creating my app, I want to make sure my app is as SEO friendly as possible. Aside from making sure my React app is server rendered (via node) and that I have meta-tags on every page, are there any npm packages that improve the SEO performance of...
more »

2017-03-13 20:03 (0) Answers

Testing with Jest and Webpack aliases

I am looking to be able to use webpack aliases to resolve imports when using jest, and optimally, reference the webpack.aliases to avoid duplication. Jest conf: "jest": { "modulePaths": ["src"], "moduleDirectories": ["node_modules"], ...
more »

2017-03-06 16:03 (2) Answers

React-router and google cached pages for SPA

I have a question about react-router and google cached pages in the results of google. In this case we have a SPA, which uses react-router (via browserHistory), the problem here is that: google cached page is a page wrapper, where the URL-a differs b...
more »

2017-02-26 08:02 (1) Answers

How to manage AngularJS http requests calls

I have a piece of code that sends a double HTTP request.I want to first make a request for authentication and if true execute the next statement (that just returns a $http promise). How can I do this in angularJS. As of now it is returning undefine...
more »

2017-02-23 19:02 (3) Answers

React - Load JSON and render component

As the title says, I'm trying to render a React component which contains data that I grabbed from a JSON by loading it using fetch(). The api call works just fine, but I'm not able to render the data. Here's the code: class App extends React.Co...
more »

2017-02-23 14:02 (4) Answers

Django Forms with ReactJS

Sorry if this seems like a dumb question but I have spent a lot of time on this and unable to figure out an ideal way to do this. I have Django forms rendered using Django templates. Now I want to add a React component to one of the form fields (and...
more »

2017-02-17 13:02 (1) Answers

Distribute CSS with a React component

I have a React component index.js which has styling in style.css. I want to distribute this component on npm, but I am confused about how I can make it easy for other developers to use the styling. There are three options I have seen: Use require...
more »

2017-02-16 16:02 (3) Answers

Ajax won't send post to rails app

I have a webpack frontend with a rails backend. They are running on different ports, and I believe this is causing me problems when I am trying to post form data to one of my rails controller end points. I have googled for a few hours and I am gettin...
more »

2017-02-12 18:02 (1) Answers

React testing setup with rails/webpacker

I've added webpacker to my existing rails app, everything is working like a charm. Webpack config is found under config/webpack/shared.js config/webpack/development.js config/webpack/production.js node_modules are installed in vendor/node_module...
more »

2017-02-10 17:02 (1) Answers

i want to display JSON result in reactJs

This is my JSON result Using Map function to display JSON array elements in reactJs.I have tried with the following code. I'm unable to get results and it says "Cannot read property '_currentElement' of null". Kindly help me to solve this. imp...
more »

2017-02-04 13:02 (1) Answers

Meteor: Using methods from react classes

In meteor, how do I use a method inside a react class? I want to trigger a method inside a react class with a keypress, but cant seem to access it with class.method() In toolbar.js: import React, { Component } from 'react'; class Toolbar extends ...
more »

2017-02-04 09:02 (1) Answers

Access JSON file in React without importing it

I have been importing data in the form of a JSON file into a React component: import data from '../../public/json/data.json'; I am using the create-react-app tool, and when I run npm run build, as expected the data.json file is bundled as part of t...
more »

2017-01-31 17:01 (1) Answers

React fade in element

I have a Basket component which needs to toggle a BasketContents component when clicked on. This works: constructor() { super(); this.state = { open: false } this.handleDropDown = this.handleDropDown.bind(this); } handleDro...
more »

2017-01-25 14:01 (3) Answers