Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DevTool hides children #15

Open
edvinerikson opened this issue Apr 22, 2016 · 1 comment
Open

DevTool hides children #15

edvinerikson opened this issue Apr 22, 2016 · 1 comment

Comments

@edvinerikson
Copy link
Contributor

DevTool does not display children of components that doesn't call setState.
Everything works as expected with the firmata mock. To reproduce this you will need to have the actual hardware.

Tested in React Native DevTools inside Nuclide.
RH version: master
Hardware: Arduino UNO
Firmata: 0.11.3

Expected behavior

<Led>
  <pin pin={9} value={1} />
</Led>

Actual behavior

<Led />

Example that hides children

import React, {Component} from 'react';
import {getPort} from '../port';
import ReactHardware from '../../src';

class Led extends Component {
  render() {
    return (
      <pin
        pin={9}
        value={1}
        mode={'OUTPUT'}
      />
    );
  }
}
ReactHardware.render(
  <Led />,
  getPort(),
  (inst) => {
    console.log('Rendered <%s />', Led.name);
  }
);

Example that shows children

import React, {Component} from 'react';
import {getPort} from '../port';
import ReactHardware from '../../src';

class Led extends Component {
  constructor() {
    super();
    this.state = {value: 1};
  }
  componentDidMount() {
    this.setState({value: 0});
  }
  render() {
    return (
      <pin
        pin={9}
        value={this.state.value}
        mode={'OUTPUT'}
      />
    );
  }
}
ReactHardware.render(
  <Led />,
  getPort(),
  (inst) => {
    console.log('Rendered <%s />', Led.name);
  }
);
@iamdustan
Copy link
Owner

Nice discovery! This is likely going to be deferred until facebook/react#6549 lands which will likely supersede the entire DevTools integration that is currently implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants