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

Enable onMouseOut for disabled elements in the html

In react-rails, the onMouseOut event works only if the element is not disabled. Following is the code in the render method: dom.button type: 'submit' 'data-toggle': "popover" title: "Form Requirements" 'data-content':…
Vipin Verma
  • 5,330
  • 11
  • 50
  • 92
0
votes
1 answer

React on Rails: Jsx and Coffeescritpt display @props

I am very new to React. How do I display @props using Jsx and CoffeeScript? In my file records.js.jsx.coffee I have the following code to display a record's date and title: @Record = React.createClass render: -> ` …
srm
  • 655
  • 1
  • 8
  • 21
0
votes
1 answer

react-bootstrap - How to use server side rendering?

I'm using Rails with react-rails gem. Server side works perfect, but recently I added react-bootstrap to the project. All good, except the fact that react-server references twice the react script, which causes inconsistencies with the…
0
votes
2 answers

SyntaxError: [stdin]:24:11: unexpected . React-Rails

I'm trying to make form with react-rails gem. But I receive an error: SyntaxError: [stdin]:24:11: unexpected . By trial I've found, that problem is in first React.DOM.div line (it's marked in code), but I don't understand, why it's happened, I've…
Peter Tretyakov
  • 3,380
  • 6
  • 38
  • 54
0
votes
2 answers

React-rails component generator using es6 class results in .jsx extension

When generating components using react-rails, my es6 class components are created with a .jsx extension? Why is that? Example rails generate react:component TestComponent --es6 results in a test_component.es6.jsx file instead of test_component.es6
0
votes
1 answer

server side rendering with react-router-relay and react-rails

My server side is rails and I'm using react-rails with server side rendering (prerender: true). Recently started using relay with react-router-relay but with that, server side rendering is no longer possible, as apparently fetching the data involves…
0
votes
2 answers

React.js - Rails: Set State

I have two components: App and Registration Form The form has two inputs: Name and Last name Looking at the App state in dev. tools I see length: undefined and name: "name entered". I'm not getting any errors but I'm missing the last name. This is…
Asan
  • 151
  • 2
  • 16
0
votes
1 answer

Use react-rails with packages that have react as dependency

I've been playing with rails-react and it works great. Recently I added the react-dropzone library in my package.json. I get the following error when I run npm install: npm WARN EPEERINVALID react-dropzone@3.2.2 requires a peer of react@^0.14.0 but…
PericlesTheo
  • 2,429
  • 2
  • 19
  • 31
0
votes
2 answers

gem react-rails, what is wrong with my coffee style?

It's my first time when I try to work with react. And I do not understand what's going on.. :) A have: Dislike = React.createClass render: -> if @props.auth == true React.DOM.a className: '' React.DOM.i …
0
votes
1 answer

Passing parameter value from react component

In my app, people can comment on pets' images. I am using the react example from here, although I changed quite a few stuff. Right now, it is successful in displaying the existing comments. Now, when a user is creating a comment, I have to pass the…
user2857014
  • 507
  • 3
  • 10
  • 22
0
votes
1 answer

React LinkedStateMixin with geocomplete

Currently using Rails 4 with react-rails gem and geocomplete gem. All worked fine(ish) until I've changed the front end to use Reactjs. When I type few characters, the autocomplete list shows up. I choose the location but only the few characters are…
Sylar
  • 11,422
  • 25
  • 93
  • 166
0
votes
0 answers

How to access children components props with react-rails

I have watched this talk and I am right now trying to use react components to show a list of messages (in a chat). So I have two react components: 1) The "Message" component that is basicaly an li with the message props (dateTime, userName, and…
Badr Tazi
  • 749
  • 1
  • 6
  • 20
0
votes
0 answers

How to mount react_component from ajax html in rails

I use this in ruby on rails with react-rails. In my app ,I want to use ajax to get a html response: <%= react_component('Post') %> Post Component: var Component = React.createClass({ render:function(){ return
Article
; …
Leen
  • 231
  • 1
  • 3
  • 6
0
votes
1 answer

ReactJS, Rails and Module.export

Sorry for the slightly generic question. I am working on a Ruby on Rails and React.js based app using the react_rails gem and have reached a point where I need the ability to require modules across JS files. I have tried every example I can find…
Tom Pinchen
  • 2,467
  • 7
  • 33
  • 53
0
votes
1 answer

Advice on using modals with Reactjs and Rails

Can someone share their approach on using modals with the react-rails gem? I've tried a few solutions like material-ui and others and I keep either getting errors or unresponsive modals. I'm using: The react-rails gem Browserify-rails Reactify I'm…
Jshoe523
  • 3,851
  • 2
  • 18
  • 21
1 2 3
18
19