<commit_before>import React from 'react'
import { requireNativeComponent, Platform } from 'react-native';
import NavigationBar from './NavigationBar';
import SearchBar from './SearchBar';

const CoordinatorLayout = ({overlap, children}) => {
    var {clonedChildren, searchBar} = React.Children.toArray(children)
        .reduce((val, child: any) => {
            if (child.type === NavigationBar) {
                var barChildren = React.Children.toArray(child.props.children);
                val.searchBar = barChildren.find(({type}: any) => type === SearchBar);
                child = React.cloneElement(child, child.props, barChildren.filter(c => c !== val.searchBar))
            }
            val.clonedChildren.push(child);
            return val;
        }, {clonedChildren: [], searchBar: null});
    return (
        <>
            <NVCoordinatorLayout overlap={overlap} style={{flex: 1}}>{clonedChildren}</NVCoordinatorLayout>
            {searchBar}
        </>
    );
};
const NVCoordinatorLayout = requireNativeComponent<any>('NVCoordinatorLayout', null)

export default Platform.OS === 'android' ? CoordinatorLayout : ({children}) => children;
<commit_msg>Added ref to coodinator layout native component<commit_after>import React from 'react'
import { requireNativeComponent, Platform } from 'react-native';
import NavigationBar from './NavigationBar';
import SearchBar from './SearchBar';

class CoordinatorLayout extends React.Component<any, any> {
    private ref: React.RefObject<any>;
    constructor(props) {
        super(props);
        this.ref = React.createRef<any>();
    }
    render() {
        var {overlap, children} = this.props;
        var {clonedChildren, searchBar} = React.Children.toArray(children)
            .reduce((val, child: any) => {
                if (child.type === NavigationBar) {
                    var barChildren = React.Children.toArray(child.props.children);
                    val.searchBar = barChildren.find(({type}: any) => type === SearchBar);
                    child = React.cloneElement(child, child.props, barChildren.filter(c => c !== val.searchBar))
                }
                val.clonedChildren.push(child);
                return val;
            }, {clonedChildren: [], searchBar: null});
        return (
            <>
                <NVCoordinatorLayout
                    ref={this.ref}
                    overlap={overlap}
                    style={{flex: 1}}
                    onTouchStart={e => {
                        console.log(this.ref);
                    }}>
                    {clonedChildren}
                </NVCoordinatorLayout>
                {searchBar}
            </>
        );
    }
}
const NVCoordinatorLayout = requireNativeComponent<any>('NVCoordinatorLayout', null)

export default Platform.OS === 'android' ? CoordinatorLayout : ({children}) => children;

{'fraction_non_alphanumeric': 0.12821403752605975, 'fraction_numerical': 0.0006949270326615705, 'mean_word_length': 2.256787330316742, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 26, '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': '1207752', 'n_tokens_mistral': 755, 'n_tokens_neox': 729, 'n_words': 160}