Questions tagged [react-rails]

Regarding React.js + Ruby on Rails, especially the `react-rails` gem.

react-rails is a Ruby gem for integrating React.js into a Ruby on Rails application. Topics include transforming JSX, mounting React components into Rails views, and rendering React components on the server. Learn more on Github: https://github.com/reactjs/react-rails.

282 questions
0
votes
1 answer

Can I use <%= tag %> in React-Rails?

I have a question. I'm making a form using react-rails. Can I use <%= tag %> in React-Rails to call data from a database? I tried something like this but it's not working.
0
votes
1 answer

Passing down props in react rails and setting refs

I am trying to build a simple rails backend and react frontend blog app. Everything was going fine until I get to edit action when I was trying to edit a post. I can not set propTypes and using refs in form. I am getting the following error [![see…
Hindreen
  • 98
  • 1
  • 9
0
votes
1 answer

What is correct way to add onChange event inside html element in React?

I am using fullcalendar library for the calendar feature. It has one of the callback function to change the viewRender of the calendar. I am modifying it to change the title to dropdown select by appending the html element. viewRender:…
Code father
  • 585
  • 1
  • 11
  • 23
0
votes
0 answers

Using old JavaScript files with webpack, what is the ES6 way?

I have used the react-rails gem for a while. While using it, I placed my ES6 components under app/assets/javascript/components folder and placed plain old JavaScript files to app/assets/javascript. The good thing was I was able to easily refer the…
Mehmet Kaplan
  • 1,723
  • 2
  • 20
  • 43
0
votes
1 answer

rails webpacker react MissingEntryError

I'm trying to setup my new project with Rails 5.1 and Wepacker-react, but I get first error very quickly. I have been created new component in javascript/packs The code is basic: javascript/packs/home.jsx import React from 'react' import ReactDOM…
0
votes
1 answer

React-Rails Cannot read property 'render' of undefined

I am just installing React-Rails gem into my project and i've been configuring a little more to be able to use import's in javascript using Browserify. I have a component in a view which I am calling in my components file and making it…
luke
  • 1,513
  • 2
  • 20
  • 38
0
votes
2 answers

Uncaught Error: You should not use or withRouter() outside a

I'm using the react-rails gem (v 2.3) with react-router-dom (v 4.2.2) and mounting my root component App on my root Rails route. This is how it's being mounted: <%= react_component("App") %> And this is the component itself: const Router =…
RoyK
  • 11
  • 1
  • 2
0
votes
2 answers

There are erros when deployed to Heroku

My rails app uses react-rails and I deployed my project to Heroku. And it was finished successfully. But I can't connect the project on Heroku. It shows error page. So I have checked heroku logs. 2017-09-23T15:11:19.654651+00:00 app[web.1]: Started…
Andrey
  • 53
  • 7
0
votes
2 answers

changing props in react_component when using react_rails

I am using this helper to display a datepicker component <%= react_component "MyDatePicker", startDate: '', endDate: ''%> I want to pass javascript values to startDate and endDate props. Any possible way to do this?
Abhilash
  • 2,864
  • 3
  • 33
  • 67
0
votes
0 answers

Only a ReactOwner can have refs. error using react-rails

I'm getting this error it a basic react-rails based app. Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's render method, or you have multiple copies of React loaded Here is…
mikeym
  • 5,705
  • 8
  • 42
  • 62
0
votes
1 answer

Using React router with react-rails gem

I am an experienced ruby on rails developer and trying to use reactjs with it. So I installed react-rails gem and followed the instructions. There are two possible approaches to get started: Using asset pipeline Using webpacker Webpacker gem…
0
votes
2 answers

How to pass contenteditable attribute to html?

I want to make content editable by using contenteditable attribute. But when I add it to my component - it's nowhere to be found. class CompName extends React.Component { render() { return (
Aurimas
  • 2,577
  • 5
  • 26
  • 37
0
votes
1 answer

Multiple Uncaught Errors Using the react-rails Gem

To preface my question, I am following this guide. When trying to build a CRUD interface using Rails and React, I receive this error when trying to create a new item: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a…
Mike
  • 1,080
  • 1
  • 9
  • 25
0
votes
1 answer

React Rails: Objects are not valid as a react child

I'm using rails 5.1 with the react-rails gem. My model has a "start_time" column that uses the "tod" (time of day gem), so it is serialized in my model like this: serialize :start_time, Tod::TimeOfDay I need to parse this time in my react view, but…
TopperH
  • 2,183
  • 18
  • 33
0
votes
0 answers

Rails - using a minified copy of the development build of React

I am using react-rails gem in order to use React within Rails. Since I upgraded react-rails gem version to 2.0.2, it started giving me warning application-0a65875….js:1842 Warning: It looks like you're using a minified copy of the development build…
Sebin
  • 1,044
  • 1
  • 8
  • 21