How to use the react-atom-fork.renderComponent function in react-atom-fork

To help you get started, we’ve selected a few react-atom-fork examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alexcorre / git-blame / lib / controllers / blameViewController.js View on Github external
var editorView = atom.views.getView(editor);
  if (!editorView.blameView) {
    var remoteUrl = projectBlamer.repo.getOriginURL(filePath);
    var remoteRevision;
    try {
      remoteRevision = RemoteRevision.create(remoteUrl);
    } catch (e) {
      // the only exception possible occurs when the template string is invalid
      // TODO refactor this to not throw an exception
    }

    // insert the BlameListView after the gutter div
    var mountPoint = $('<div>', {'class': 'git-blame-mount'});
    $(editorView.rootElement).find('.gutter').after(mountPoint);

    editorView.blameView = React.renderComponent(new BlameListView({
      projectBlamer: projectBlamer,
      remoteRevision: remoteRevision,
      editorView: editorView
    }), mountPoint[0]);
  } else {
    editorView.blameView.toggle();
  }
}
</div>
github Floobits / floobits-atom / lib / asdf-view.js View on Github external
ASDF.prototype.createdCallback = function(first_argument) {
  if (!this.shadow) {
    this.shadow = this.createShadowRoot();
  }
  this.styles = document.createElement('style');
  this.styles.textContent = ".floobits {color: red}";
  this.shadow.appendChild(this.styles.cloneNode(true));
  
  this.styles.setAttribute('context', 'floobits-asdf');

  this.root = document.createElement('div');
  this.root.classList.add('floobits');

  this.shadow.appendChild(this.root);

  this.component = React.renderComponent(Component(), this.root);
};
github Floobits / floobits-atom / lib / react_wrapper.js View on Github external
Proto.attachedCallback = function () {
    this.reactNode = React.renderComponent(this.component, this);
  };

react-atom-fork

Minimal, Atom-specific fork of React. Allows us to opt out of selection restoration and event dispatch.

MIT
Latest version published 10 years ago

Package Health Score

73 / 100
Full package analysis