How to use the inferno-compat.Children.toArray function in inferno-compat

To help you get started, we’ve selected a few inferno-compat 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-compat / __tests__ / misc.spec.jsx View on Github external
it('Should return child in array', () => {
      const divOne = <div>;

      expect(Children.toArray(divOne)).toEqual([divOne]);
    });
</div>
github infernojs / inferno / packages / inferno-compat / __tests__ / misc.spec.jsx View on Github external
it('Should return empty array if its null/undef', () => {
      const children = null;

      expect(Children.toArray(children)).toEqual([]);
    });
  });
github infernojs / inferno / packages / inferno-compat / __tests__ / misc.spec.jsx View on Github external
it('Should return array if its already array', () =&gt; {
      const children = [<div>];

      expect(Children.toArray(children)).toEqual(children);
    });
</div>