How to use the react-uid.uid function in react-uid

To help you get started, we’ve selected a few react-uid 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 theKashey / react-imported-component / src / Component.tsx View on Github external
function ImportedComponent(props: ComponentOptions): ReactElement | null {
  const {loading, error, loadable, imported: Component, retry} = useImported(props.loadable);

  if (loading && props.async) {
    throw loadable.resolution;
  }

  if ('render' in props && props.render) {
    return props.render(Component, {loading, error}, props.forwardProps)
  }

  if (Component) {
    // importedUUID for cache busting
    return 
  }

  if (loading) {
    if (props.async) {
      throw loadable.resolution;
    }
    return props.LoadingComponent
      ? 
      : null;
  }

  if (error) {
    // always report about errors
    console.error('react-imported-component', error);
    // let's rethrow the error after react leaves this function
    // this might be very crucial for the "safe" dev mode
github South-Paw / react-vector-maps / docs / src / pages / props.js View on Github external
{items.map(({ prop, type, required, defaultProp, description }, id) => (
          
            {prop &amp;&amp; <code>{prop}</code>}
            {type &amp;&amp; <code>{type}</code>}
            {required &amp;&amp; &lt;&gt;✔️}
            {defaultProp &amp;&amp; <code>{defaultProp}</code>}
            {description &amp;&amp; &lt;&gt;{description}}
          
        ))}
github South-Paw / react-vector-maps / docs / src / components / Layout / Layout.js View on Github external
{items.map(item =&gt; {
                const { label, ...other } = item;
                return (
                  
                    {label}
                  
                );
              })}
github keystonejs / keystone / packages / app-admin-ui / client / components / Nav / index.js View on Github external
function renderChildren(
  node,
  authListKey,
  mouseIsOverNav,
  getListByKey,
  adminPath,
  depth,
  onRenderIndexPage
) {
  if (node.children) {
    const groupKey = uid(node.children);
    depth += 1;

    return (
      
        {node.label &amp;&amp; {node.label}}
        {node.children.map(child =&gt;
          renderChildren(
            child,
            authListKey,
            mouseIsOverNav,
            getListByKey,
            adminPath,
            depth,
            onRenderIndexPage
          )
        )}

react-uid

Render-less container for ID generation

MIT
Latest version published 1 year ago

Package Health Score

56 / 100
Full package analysis