<commit_before>import React from 'react';
import Link from 'react-router/lib/Link';

/**
 * Logout link component
 * @module LogoutLink
 */
class LogoutLink extends React.Component {
	render() {
		const {
			to,
			children,
			location,
			...other
		} = this.props;

		const path = typeof to !== 'undefined' ? to : location;

		console.log(this.props.location);
		console.log(path);

		return (
			<Link
				to={{ pathname: path, query: {logout: true} }}
				{...other}
			>
				{children}
			</Link>
		);
	}
}

LogoutLink.propTypes = {
	to: React.PropTypes.string
};

export default LogoutLink;<commit_msg>subscribe to context<commit_after>import React from 'react';
import Link from 'react-router/lib/Link';

/**
 * Logout link component
 * @module LogoutLink
 */
class LogoutLink extends React.Component {
	render() {
		const {
			to,
			children,
			...other
		} = this.props;

		const { router } = this.context;
		console.log(router);

		// const path = typeof to !== 'undefined' ? to : location;

		return (
			<Link
				to={{ pathname: to, query: {logout: true} }}
				{...other}
			>
				{children}
			</Link>
		);
	}
}

LogoutLink.propTypes = {
	to: React.PropTypes.string
};

LogoutLink.contextTypes = {
	router: React.PropTypes.object
};

export default LogoutLink;
{'fraction_non_alphanumeric': 0.15023474178403756, 'fraction_numerical': 0.0, 'mean_word_length': 3.0220125786163523, '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': '4528068', 'n_tokens_mistral': 499, 'n_tokens_neox': 435, 'n_words': 105}