How to use @fluentui/react-component-ref - 10 common examples

To help you get started, we’ve selected a few @fluentui/react-component-ref 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 microsoft / fluent-ui-react / packages / react / src / components / Debug / Debug.tsx View on Github external
<>
          
          {isSelecting && (
            
          )}
          {isSelecting && fiberNav && fiberNav.domNode && (
            
          )}
          {isSelecting && fiberNav && }
          {selectedFiberNav && }
          {!isSelecting && fiberNav && fiberNav.instance && (
github microsoft / fluent-ui-react / packages / react / src / components / Toolbar / Toolbar.tsx View on Github external
renderComponent({
    accessibility,
    ElementType,
    classes,
    styles,
    variables,
    unhandledProps,
    rtl,
  }): React.ReactNode {
    const windowRef = toRefObject(this.context.target.defaultView)

    this.rtl = rtl
    const { children, items, overflow, overflowItem } = this.props

    if (!overflow) {
      return (
        
          {childrenExist(children) ? children : this.renderItems(items, variables)}
        
      )
    }
github microsoft / fluent-ui-react / packages / react / src / components / Tooltip / Tooltip.tsx View on Github external
tooltipPositionClasses: string,
    rtl: boolean,
    accessibility: ReactAccessibilityBehavior,
  ): JSX.Element {
    const { align, position, target, offset } = this.props
    const { open } = this.state

    return (
      
    )
  }
github microsoft / fluent-ui-react / packages / react / src / components / Popup / Popup.tsx View on Github external
popupPositionClasses: string,
    rtl: boolean,
    accessibility: ReactAccessibilityBehavior,
  ): JSX.Element {
    const { align, position, offset, target, unstable_pinned } = this.props

    return (
      
    )
  }
github microsoft / fluent-ui-react / packages / react / src / components / Popup / Popup.tsx View on Github external
rtl: boolean,
    accessibility: ReactAccessibilityBehavior,
    { placement, scheduleUpdate }: PopperChildrenProps,
  ) => {
    const {
      content: propsContent,
      renderContent,
      contentRef,
      mountDocument,
      pointing,
      trapFocus,
      autoFocus,
    } = this.props

    const content = renderContent ? renderContent(scheduleUpdate) : propsContent
    const targetRef = toRefObject(mountDocument || this.context.target)

    const popupContent = Popup.Content.create(content || {}, {
      defaultProps: () => ({
        ...(rtl && { dir: 'rtl' }),
        ...accessibility.attributes.popup,
        ...accessibility.keyHandlers.popup,
        className: popupPositionClasses,
        ...this.getContentProps(),
        placement,
        pointing,
        pointerRef: this.pointerTargetRef,
        trapFocus,
        autoFocus,
      }),
      overrideProps: this.getContentProps,
    })
github microsoft / fluent-ui-react / packages / react / src / components / Debug / Debug.tsx View on Github external
render() {
    const { mountDocument } = this.props
    const { fiberNav, selectedFiberNav, isSelecting, debugPanelPosition } = this.state

    if (process.env.NODE_ENV !== 'production' && isDebugEnabled) {
      return (
        <>
          
          {isSelecting && (
            
          )}
          {isSelecting && fiberNav && fiberNav.domNode && (
github microsoft / fluent-ui-react / packages / react / src / components / Toolbar / ToolbarMenuItem.tsx View on Github external
renderComponent({ ElementType, classes, accessibility, unhandledProps, styles, rtl }) {
    const {
      active,
      activeIndicator,
      children,
      content,
      disabled,
      submenuIndicator,
      icon,
      menu,
      popup,
      wrapper,
    } = this.props
    const { menuOpen } = this.state

    const targetRef = toRefObject(this.context.target)

    const elementType = (
      
        {childrenExist(children) ? (
          children
        ) : (
          <>
            {Icon.create(icon, {
              defaultProps: () => ({ xSpacing: !!content ? 'after' : 'none' }),
github microsoft / fluent-ui-react / packages / react / src / components / Toolbar / ToolbarItem.tsx View on Github external
renderComponent({ ElementType, classes, unhandledProps, accessibility, variables }) {
    const { icon, children, disabled, popup, menu, menuOpen, wrapper } = this.props
    const targetRef = toRefObject(this.context.target)

    const itemElement = (
      
        {childrenExist(children) ? children : Icon.create(icon)}
      
    )
    const submenuElement = menuOpen ? (
github microsoft / fluent-ui-react / packages / react / src / components / Input / Input.tsx View on Github external
innerRef={(inputElement: HTMLElement) => {
                handleRef(this.inputRef, inputElement)
                handleRef(inputRef, inputElement)
              }}
            >
github microsoft / fluent-ui-react / packages / react / src / components / Slider / Slider.tsx View on Github external
innerRef={(inputElement: HTMLElement) => {
              handleRef(this.inputRef, inputElement)
              handleRef(inputRef, inputElement)
            }}
          >

@fluentui/react-component-ref

A set of components and utils to deal with React refs.

MIT
Latest version published 2 years ago

Package Health Score

77 / 100
Full package analysis