<commit_before>import {compose} from 'compose'
import PropTypes from 'prop-types'
import React from 'react'
import withForwardedRef from 'ref'

class AutoFocus extends React.Component {
    focusHolderRef = React.createRef()
    state = {completed: false}

    render() {
        const {completed} = this.state
        return completed ? null : <div ref={this.focusHolderRef} tabIndex={-1}/>
    }<commit_msg>Put AutoFocus focus holder in a portal.<commit_after>import {compose} from 'compose'
import PropTypes from 'prop-types'
import React from 'react'
import withForwardedRef from 'ref'
import Portal from 'widget/portal'

class AutoFocus extends React.Component {
    focusHolderRef = React.createRef()
    state = {completed: false}

    render() {
        const {completed} = this.state
        return completed
            ? null
            : <Portal type='global'>
                <div ref={this.focusHolderRef} tabIndex={-1}/>
            </Portal>
    }
{'fraction_non_alphanumeric': 0.10580912863070539, 'fraction_numerical': 0.002074688796680498, 'mean_word_length': 3.106382978723404, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3096959', 'n_tokens_mistral': 275, 'n_tokens_neox': 269, 'n_words': 83}