How to use rax-create-factory - 1 common examples

To help you get started, we’ve selected a few rax-create-factory 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 alibaba / rax / packages / rax-clone-element / src / __tests__ / cloneElement.js View on Github external
expect(() => {
      var element = createFactory(ComponentClass)({
        key: '12',
        ref: '34',
        foo: '56',
      });
      var props = {
        key: undefined,
        ref: undefined,
        foo: 'ef',
      };
      var clone = cloneElement(element, props);
      expect(clone.type).toBe(ComponentClass);
      expect(clone.key).toBe('12');
      expect(clone.ref).toBe('34');
      expect(clone.props).toEqual({foo: 'ef'});
    }).toWarnDev('Adding a string ref "34" that was not created inside render method, or multiple copies of Rax are used.', {withoutStack: true});
  });

rax-create-factory

Rax createFactory

BSD-3-Clause
Latest version published 5 years ago

Package Health Score

56 / 100
Full package analysis

Popular rax-create-factory functions

Similar packages