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

React prerender.io fetch as google is not working

I am using prerender for ExpressJS app. I've kept <meta name="fragment" content="!"> in index.html page. It is working fine when I am using mywebsite.com/?_escape_fragment_=, but when I use fetch as google for mywebsite.com/ I see no data. But ...
more »

2017-01-25 04:01 (1) Answers

`React/RCTBridgeModule.h` file not found

Getting this error while building a react-native iOS app on xcode. Started getting this error after npm install and rpm linking react-native-fs library. But after searching online for a solution, I noticed that many people are getting the same err...
more »

2017-01-15 16:01 (3) Answers

React expose component function

Based on the example on this link http://reactjs.cn/react/tips/expose-component-functions.html, I have been trying to simplify the code to understand exposed methods better, so I got the following, which doesn't work, the error is "Uncaught TypeError...
more »

2017-01-05 00:01 (2) Answers

React searching for a user and rendering it out

FIXED: Solution: use this.props.name and add key value to tag I have some constant data that I am just trying to render to screen. I can render all of the data at once, but what I really want to do is search for a user and only render out their pr...
more »

2017-01-04 22:01 (2) Answers

User authentication with ASP MVC and React

In C# and with claims it is easy to set up a login system. I am wondering how to correctly do it with React and C# as a back-end? Do I have to send login and password from React's form with an xmlhttp post request and check if it exist? Should I the...
more »

2017-01-02 22:01 (1) Answers

POST with Body Not Passing Cookies

I'm using the axios-cookiejar-support library. I have a POST that contains a body, and for some reason, the Cookies aren't getting injected into the request. What did I do wrong here: return axios .post( urlJoin( config.port...
more »

2016-12-14 13:12 (1) Answers