mirror of
https://github.com/zhigang1992/react-native-gifted-chat.git
synced 2026-01-12 22:50:22 +08:00
* chore(test): add jest * chore(coverage): add codecov to circleci * chore(vscode): remove vscode from git * chore(test): snapshot all component
33 lines
684 B
JavaScript
33 lines
684 B
JavaScript
/* eslint react/prop-types: 0, padded-blocks: 0 */
|
|
|
|
import 'react-native';
|
|
import React from 'react';
|
|
import renderer from 'react-test-renderer';
|
|
import PropTypes from 'prop-types';
|
|
|
|
class Context extends React.Component {
|
|
getChildContext() {
|
|
return {
|
|
actionSheet: () => {},
|
|
getLocale: () => 'en',
|
|
};
|
|
}
|
|
render() {
|
|
return this.props.children;
|
|
}
|
|
}
|
|
|
|
Context.propTypes = {
|
|
children: PropTypes.element,
|
|
};
|
|
|
|
Context.childContextTypes = {
|
|
actionSheet: PropTypes.func,
|
|
getLocale: PropTypes.func,
|
|
children: PropTypes.element,
|
|
};
|
|
|
|
export default function createComponentWithContext(children) {
|
|
return renderer.create(<Context>{children}</Context>);
|
|
}
|