How to use the uncontrollable.uncontrollable function in uncontrollable

To help you get started, we’ve selected a few uncontrollable 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 react-bootstrap / react-bootstrap / src / Dropdown.js View on Github external
});
            default:
              return child;
          }
        })}
      
    );
  }
}

Dropdown.propTypes = propTypes;
Dropdown.defaultProps = defaultProps;

setBsClass('dropdown', Dropdown);

const UncontrolledDropdown = uncontrollable(Dropdown, { open: 'onToggle' });

UncontrolledDropdown.Toggle = DropdownToggle;
UncontrolledDropdown.Menu = DropdownMenu;

export default UncontrolledDropdown;
github react-bootstrap / react-bootstrap / src / Navbar.js View on Github external
return (
      
        {children}
      
    );
  }
}

Navbar.propTypes = propTypes;
Navbar.defaultProps = defaultProps;
Navbar.childContextTypes = childContextTypes;

setBsClass('navbar', Navbar);

const UncontrollableNavbar = uncontrollable(Navbar, { expanded: 'onToggle' });

function createSimpleWrapper(tag, suffix, displayName) {
  const Wrapper = (
    { componentClass: Component, className, pullRight, pullLeft, ...props },
    { $bs_navbar: navbarProps = { bsClass: 'navbar' } }
  ) => (
    
  );
github react-bootstrap / react-bootstrap / src / ToggleButtonGroup.js View on Github external
return React.cloneElement(child, {
            type,
            name: child.name || name,
            checked: values.indexOf(value) !== -1,
            onChange: chainFunction(onChange, handler)
          });
        })}
      
    );
  }
}

ToggleButtonGroup.propTypes = propTypes;
ToggleButtonGroup.defaultProps = defaultProps;

const UncontrolledToggleButtonGroup = uncontrollable(ToggleButtonGroup, {
  value: 'onChange'
});

UncontrolledToggleButtonGroup.Button = ToggleButton;

export default UncontrolledToggleButtonGroup;
github react-bootstrap / react-bootstrap / src / Tabs.js View on Github external
unmountOnExit={unmountOnExit}
          >
            {children}
          
        
      
    );
  }
}

Tabs.propTypes = propTypes;
Tabs.defaultProps = defaultProps;

setBsClass('tab', Tabs);

export default uncontrollable(Tabs, { activeKey: 'onSelect' });
github intljusticemission / react-big-calendar / src / Calendar.js View on Github external
notify(this.props.onSelectSlot, slotInfo)
  }

  handleDrillDown = (date, view) => {
    const { onDrillDown } = this.props
    if (onDrillDown) {
      onDrillDown(date, view, this.drilldownView)
      return
    }
    if (view) this.handleViewChange(view)

    this.handleNavigate(navigate.DATE, date)
  }
}

export default uncontrollable(Calendar, {
  view: 'onView',
  date: 'onNavigate',
  selected: 'onSelectEvent',
})
github react-bootstrap / react-bootstrap / src / TabContainer.js View on Github external
render() {
    const { children, ...props } = this.props;

    delete props.generateChildId;
    delete props.onSelect;
    delete props.activeKey;

    return React.cloneElement(React.Children.only(children), props);
  }
}

TabContainer.propTypes = propTypes;
TabContainer.childContextTypes = childContextTypes;

export default uncontrollable(TabContainer, { activeKey: 'onSelect' });

uncontrollable

Wrap a controlled react component, to allow specific prop/handler pairs to be uncontrolled

MIT
Latest version published 1 year ago

Package Health Score

70 / 100
Full package analysis