How to use the inferno.createRef function in inferno

To help you get started, we’ve selected a few inferno 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 infernojs / inferno / packages / inferno-hydrate / __tests__ / hydrate.spec.js View on Github external
it('Should work with object ref on element vNode', () => {
      // create matching DOM
      container.innerHTML = '<div>Okay<span>foobar</span></div>';

      let newRef = createRef();

      hydrate(
        <div>
          Okay
          <span>Foobar</span>
        </div>,
        container
      );

      expect(newRef.current).toBe(container.querySelector('span'));
      expect(container.innerHTML).toBe('<div>Okay<span>Foobar</span></div>');
    });
github infernojs / inferno / packages / inferno-hydrate / __tests__ / hydrate.spec.jsx View on Github external
it('Should work with object ref on element vNode', () =&gt; {
      // create matching DOM
      container.innerHTML = '<div>Okay<span>foobar</span></div>';

      let newRef = createRef();

      hydrate(
        <div>
          Okay
          <span>Foobar</span>
        </div>,
        container
      );

      expect(newRef.current).toBe(container.querySelector('span'));
      expect(container.innerHTML).toBe('<div>Okay<span>Foobar</span></div>');
    });
github nortonandrews / kikoeru / src / client / components / AudioElement.jsx View on Github external
constructor(props) {
    super(props);
    this.audioRef = createRef();
  }