<commit_before>import * as React from 'react';
import {Router, UiSref} from '../index';
import {find} from '../utils';

export class UiSrefActive extends React.Component<any,any> {
    uiSref;
    
    static propTypes = {
        class: React.PropTypes.string.isRequired,
        children: React.PropTypes.element.isRequired
    }
    
    constructor (props) {
        super(props);
    }
    
    componentDidMount () {
        const child = this.props.children;
        this.uiSref = find(child, component => {
            return typeof component.type === 'function' && component.type.name === 'UiSref';
        });
    }
    
    isActive = () => {
        let currentState = Router.globals.current.name;
        console.log(this.uiSref);
        return this.uiSref && this.uiSref.props.to === currentState; 
    }
    
    render () {
        let isActive = this.isActive();
        return (
            !isActive 
                ? this.props.children
                : React.cloneElement(this.props.children, { className: this.props.class })
        );
    }
}<commit_msg>removed console statement<commit_after>import * as React from 'react';
import {Router, UiSref} from '../index';
import {find} from '../utils';

export class UiSrefActive extends React.Component<any,any> {
    uiSref;

    static propTypes = {
        class: React.PropTypes.string.isRequired,
        children: React.PropTypes.element.isRequired
    }

    constructor (props) {
        super(props);
    }

    componentDidMount () {
        const child = this.props.children;
        this.uiSref = find(child, component => {
            return typeof component.type === 'function' && component.type.name === 'UiSref';
        });
    }

    isActive = () => {
        let currentState = Router.globals.current.name;
        return this.uiSref && this.uiSref.props.to === currentState;
    }

    render () {
        let isActive = this.isActive();
        return (
            !isActive
                ? this.props.children
                : React.cloneElement(this.props.children, { className: this.props.class })
        );
    }
}
{'fraction_non_alphanumeric': 0.1290170132325142, 'fraction_numerical': 0.0, 'mean_word_length': 2.095029239766082, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7197966', 'n_tokens_mistral': 620, 'n_tokens_neox': 608, 'n_words': 123}