How to use the uniforms.injectName function in uniforms

To help you get started, we’ve selected a few uniforms 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 vazco / uniforms / packages / uniforms / __tests__ / injectName.tsx View on Github external
it('does nothing on normal elements', () => {
      mount(
        {injectName('fieldB', )},
        reactContext,
      );

      expect(Test.mock.calls[0]).toEqual(
        expect.arrayContaining([expect.objectContaining({ name: 'fieldA' })]),
      );
      expect(Test.mock.calls[1]).not.toEqual(
        expect.arrayContaining([
          expect.objectContaining({ name: 'fieldA.fieldB' }),
        ]),
      );
    });
github vazco / uniforms / packages / uniforms-unstyled / src / NestField.tsx View on Github external
const Nest = ({ children, fields, itemProps, label, name, ...props }) => (
  <div>
    {label &amp;&amp; <label>{label}</label>}

    {children
      ? injectName(name, children)
      : fields.map(key =&gt; (
          
        ))}
  </div>
);
github vazco / uniforms / packages / uniforms-semantic / src / NestField.tsx View on Github external
<div>
    {label &amp;&amp; (
      <div>
        <label>{label}</label>
      </div>
    )}

    {!!(error &amp;&amp; showInlineError) &amp;&amp; (
      <div>{errorMessage}</div>
    )}

    {children
      ? injectName(name, children)
      : fields.map(key =&gt; (
          
        ))}
  </div>
);
github vazco / uniforms / packages / uniforms-bootstrap4 / src / NestField.tsx View on Github external
name,
  showInlineError,
  ...props
}) =&gt; (
  <div>
    {label &amp;&amp; <label>{label}</label>}

    {!!(error &amp;&amp; showInlineError) &amp;&amp; (
      <span>{errorMessage}</span>
    )}

    {children
      ? injectName(name, children)
      : fields.map(key =&gt; (
          
        ))}
  </div>
);
github vazco / uniforms / packages / uniforms-antd / src / NestField.tsx View on Github external
error,
  errorMessage,
  fields,
  itemProps,
  label,
  name,
  showInlineError,
  ...props
}) =&gt; (
  <div>
    {label &amp;&amp; <label>{label}</label>}

    {!!(error &amp;&amp; showInlineError) &amp;&amp; <div>{errorMessage}</div>}

    {children
      ? injectName(name, children)
      : fields.map(key =&gt; (
          
        ))}
  </div>
);
github vazco / uniforms / packages / uniforms-material / src / NestField.tsx View on Github external
const Nest = ({ children, fields, itemProps, label, name, ...props }) =&gt;
  wrapField(
    { ...props, component: undefined },
    label &amp;&amp; {label},
    children
      ? injectName(name, children)
      : fields.map(key =&gt; (
          
        )),
  );
github vazco / uniforms / packages / uniforms-bootstrap3 / src / NestField.tsx View on Github external
name,
  showInlineError,
  ...props
}) =&gt; (
  <div>
    {label &amp;&amp; <label>{label}</label>}

    {!!(error &amp;&amp; showInlineError) &amp;&amp; (
      <span>{errorMessage}</span>
    )}

    {children
      ? injectName(name, children)
      : fields.map((key: any) =&gt; (
          
        ))}
  </div>
);