Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Hot reloading via react-transform/babel6 is not working when rendering a connected component from a non-connected component #224

Closed
Labels
bugSomething isn't working
@bunkat

Description

@bunkat

I think this is an issue with how react-redux handles the hot reloading of connected components. If you have a non-connected (dumb) component render a connected component as a wrapper component, any content within that wrapper will no longer be re-rendered on change.

_Connected component:_

class Form extends Component {  constructor(props) {    super(props);  }  render() {    return (      <form>        {this.props.children}      </form>    );  }}export default connect(...)(Form);

_Dumb component rendering connected component:_

class LoginForm extends Component {  constructor(props, context) {    super(props, context);  }  render() {    return (      <Form>        this is a test      </Form>    );  }}

Changing the textthis is a test will not cause the component to re-render. Replace<Form> with<div> and everything works as expected. Replaceconnect()(Form) with justForm and everything works as expected.

Repository demonstrating issue is available athttps://github.com/bunkat/counter. It is the react-redux counter example with babel6 hot loading and a new connected wrapper component.

To reproduce the issue:

  1. git clonehttps://github.com/bunkat/counter.git
  2. cd counter
  3. npm install
  4. npm start
  5. Open browser tohttp://localhost:3000
  6. Edit components/Counter.js
  7. Modify the render method, change Clicked to Not Clicked

The module will be updated via HMR, but the Counter component will not be rendered with the new text.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp