How to use inferno-create-element - 10 common examples

To help you get started, we’ve selected a few inferno-create-element 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-create-element / __tests__ / createElement.fragment.spec.js View on Github external
container
      );

      expect(container.innerHTML).toBe(SFCHtml + FragmentAHtml + SFCHtml + FragmentCHtml + SFCHtml);

      // Switch order again
      render(
        createElement(
          Fragment,
          null,
          createElement('div', { key: '1' }, '1'),
          createElement(SFC, { key: 'sfc1' }),
          createElement(SFC, { key: 'sfc2' }),
          fragmentA,
          fragmentC,
          createElement('div', { key: '1' }, '2'),
          createElement(SFC, { key: 'sfc3' })
        ),
        container
      );

      // Verify dom has changed and nodes are the same
      expect(container.innerHTML).toBe('<div>1</div>' + SFCHtml + SFCHtml + FragmentAHtml + FragmentCHtml + '<div>2</div>' + SFCHtml);

      render(null, container);

      expect(container.innerHTML).toBe('');
    });
github anticensority / runet-censorship-bypass / extensions / chromium / runet-censorship-bypass / src / extension-common / pages / options / src / components / InfoLi.js View on Github external
const inputProps = {
      id: iddy,
      name: props.name,
      type: props.type,
      checked: props.checked,
      onClick: props.onClick,
      onChange: props.onChange,
      class: props.class,
      disabled: props.ifInputsDisabled,
    };
    delete inputProps.children;

    return (
      <li style="{" class="{scopedCss.infoRow">
        {createElement('input', inputProps)}
        <div class="{scopedCss.labelContainer}">
          <label for="{iddy}"></label>
          {props.nodeAfterLabel}
        </div>
        {props.conf.desc
          ? (
            <div class="{scopedCss.desc}">
              
              <div class="{scopedCss.tooltip}">
            </div>)
          : (props.conf.url
              ? (<a title="Открыть документацию" class="{[scopedCss.rightBottomIcon," href="{props.conf.url}"></a>)
              : (<span>&nbsp;</span>) // Affects vertical align of flexbox items.
            )
        }
        {/* props.checked &amp;&amp; props.children */}</div></li>
github infernojs / inferno / packages / inferno-create-element / __tests__ / createElement.fragment.spec.js View on Github external
it('Should append DOM nodes to correct position when component root Fragmnet change', () =&gt; {
      let TestRoot = class TestRoot extends Component {
        render() {
          return createElement(Fragment, null, this.props.children);
        }
      };

      render(
        createElement(
          'div',
          null,
          createElement(TestRoot, null, createElement('div', null, '1'), createElement('div', null, '2')),
          createElement(TestRoot, null, createElement('span', null, 'Ok'), createElement('span', null, 'Test'))
        ),
        container
      );

      expect(container.innerHTML).toBe('<div><div>1</div><div>2</div><span>Ok</span><span>Test</span></div>');

      render(
        createElement(
          'div',
          null,
          createElement(
            TestRoot,
            null,
            createElement('div', null, '1'),
            createElement('div', null, '2'),
            createElement('div', null, '3'),
github infernojs / inferno / packages / inferno-create-element / __tests__ / update.ext.spec.js View on Github external
it('works', () =&gt; {
      const A = [];

      A[0] = createElement('div', null, 'text 1', createElement('br', null));

      A[1] = createElement('div', null, 'text 2');

      A[2] = createElement('div', null, createElement('br', null), 'text 4');

      render(A[0], container);
      expect(container.innerHTML).toBe(innerHTML('<div>text 1<br></div>'));
      render(A[1], container);
      expect(container.innerHTML).toBe(innerHTML('<div>text 2</div>'));
      render(A[2], container);
      expect(container.innerHTML).toBe(innerHTML('<div><br>text 4</div>'));
    });
  });
github infernojs / inferno / packages / inferno-create-element / __tests__ / createElement.fragment.spec.js View on Github external
expect(container.innerHTML).toBe('<div>2a2b2c1a1b</div>');
      expect(unmountCounter).toBe(0);
      expect(mountCounter).toBe(5);

      render(
        createElement(
          'div',
          null,
          createElement(
            Fragment,
            { key: '3' },
            createElement(TestLifecycle, null, '3a'),
            createElement(TestLifecycle, null, '3b'),
            createElement(TestLifecycle, null, '3c')
          ),
          createElement(Fragment, { key: '2' }, createElement(TestLifecycle, null, '2a'), createElement(TestLifecycle, null, '2Patched'))
        ),
        container
      );

      expect(container.innerHTML).toBe('<div>3a3b3c2a2Patched</div>');
      expect(unmountCounter).toBe(3);
      expect(mountCounter).toBe(8);
    });
github infernojs / inferno / packages / inferno-create-element / __tests__ / update.ext.spec.js View on Github external
function C() {
          return createElement(
            'div',
            null,
            createElement('div', null, createElement('table', null, createElement('tr', { key: 'row1' }, createElement('td', { key: 'td1' }, 'text1'))))
          );
        }
github infernojs / inferno / packages / inferno-create-element / __tests__ / svg.ext.spec.js View on Github external
child = () =>
      createElement(
        'circle',
        {
          xmlns: 'http://www.w3.org/2000/svg'
        },
        createElement('circle', {
          xmlns: 'http://www.w3.org/2000/svg'
        })
      );
github infernojs / inferno / packages / inferno-create-element / __tests__ / update.ext.spec.js View on Github external
const template = function(val1, val2, val3, val4, val5, val6) {
      return createElement(
        'div',
        {
          className: val2,
          id: val1
        },
        createElement(
          'div',
          {
            id: val5
          },
          createElement('span', null, val6)
        ),
        createElement(
          'div',
          {
            className: val4
          },
          val3
        )
      );
    };
github styletron / styletron / packages / styletron-inferno / src / __tests__ / browser.js View on Github external
const MockComponent = (props, context) => {
    t.equal(
      context.styletron,
      mockStyletronInstance,
      'Styletron instance on component context'
    );
    return createElement('div');
  };

  InfernoTestUtils.renderIntoDocument(
    createElement(
      Provider,
      {
        styletron: mockStyletronInstance,
      },
      createElement(MockComponent)
    )
  );
});
github styletron / styletron / packages / styletron-inferno / src / __tests__ / browser.js View on Github external
render() {
      return createElement(StyledInnerComponent, {
        foo: 'bar',
        innerRef: innerComponent => {
          t.ok(
            InfernoTestUtils.isRenderedClassComponentOfType(
              innerComponent,
              InnerComponent
            ),
            'is InnerComponent'
          );
          this.innerComponent = innerComponent;
        },
      });
    }
  }

inferno-create-element

Provides methods to create Inferno VNodes

MIT
Latest version published 4 months ago

Package Health Score

84 / 100
Full package analysis