React-hot-loader: Relay and React hot loader

Created on 7 Feb 2016  路  6Comments  路  Source: gaearon/react-hot-loader

I have gone through the troubleshooting in the the documentation but I cant seem to figure out why I keep getting [HMR] The following modules couldn't be hot updated: (They would need a full reload!) message. I am wondering if it because relay wraps the react components in containers. I would love to be able to use this tool, any help would be appreciated.

Most helpful comment

fwiw: I fixed this by exporting the container and the component, no need to split into multiple files.

My person.js:

import React from 'react';
import Relay from 'react-relay';

export class _Person extends React.Component { ... }
export var Person = Relay.createContainer(_Person, { ... })

My application.js:

import { Person } from './Person'

All 6 comments

@peterpine83 have you fixed it?

as stated in https://github.com/fortruce/relay-skeleton/issues/1#issuecomment-131881653, we can in the meantime split the containers and the stateless components into 2 separate files (and making sure the stateless component is a class)

fwiw: I fixed this by exporting the container and the component, no need to split into multiple files.

My person.js:

import React from 'react';
import Relay from 'react-relay';

export class _Person extends React.Component { ... }
export var Person = Relay.createContainer(_Person, { ... })

My application.js:

import { Person } from './Person'

It would be very useful to have this small workaround in the docs! Google sent me here and it solved my problem immediately!

Thank you, @Willianvdv ! 馃槂

@Willianvdv thanks !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

theKashey picture theKashey  路  4Comments

calvinchankf picture calvinchankf  路  3Comments

rockchalkwushock picture rockchalkwushock  路  3Comments

tiberiumaxim picture tiberiumaxim  路  4Comments

JamesIves picture JamesIves  路  4Comments