<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import Popper from '../Popper';

const OptionsListWrapper = React.forwardRef(({
  useLegacy,
  children,
  controlRef,
  isOpen,
  renderToOverlay,
  menuPropGetter,
  modifiers,
  ...props
}, ref) => {
  if (useLegacy) {
    return <div {...menuPropGetter()} {...props} ref={ref} hidden={!isOpen}>{children}</div>;
  }

  const {
    overlayRef,
    ...menuRest
  } = menuPropGetter({ ref, refKey: 'overlayRef' });

  let portal;
  if (renderToOverlay) {
    portal = document.getElementById('OverlayContainer');
  }

  return (
    <Popper<commit_msg>Fix ref on downshift element<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import Popper from '../Popper';

const OptionsListWrapper = React.forwardRef(({
  useLegacy,
  children,
  controlRef,
  isOpen,
  renderToOverlay,
  menuPropGetter,
  modifiers,
  ...props
}, ref) => {
  if (useLegacy) {
    return <div {...menuPropGetter({ ref })} {...props} hidden={!isOpen}>{children}</div>;
  }

  const {
    overlayRef,
    ...menuRest
  } = menuPropGetter({ ref, refKey: 'overlayRef' });

  let portal;
  if (renderToOverlay) {
    portal = document.getElementById('OverlayContainer');
  }

  return (
    <Popper
{'fraction_non_alphanumeric': 0.15306122448979592, 'fraction_numerical': 0.0, 'mean_word_length': 3.619565217391304, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5988184', 'n_tokens_mistral': 419, 'n_tokens_neox': 427, 'n_words': 97}