Skip to content

Allow namespacing in refs #430

Closed
Closed
@shripadk

Description

@shripadk

It'll be great if one could namespace references to backing instances returned from render.

Silly example:

var Editor = React.createClass({
  componentDidMount: function() {
    if(this.refs.hasOwnProperty('syntax') {
      for(var lang in this.refs.syntax) {
        var editor = this.refs.syntax[lang];
        editor.prettify().colorize();
      }
    }

    this.refs.plain.prettify();
  },
  render: function() {
    return (
      <div id='content'>
        <TextEditor ref='syntax.javascript' />
        <TextEditor ref='syntax.html' />
        <TextEditor ref='syntax.css' />
        <TextEditor ref='plain' />
      </div>
    );
  }
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions