Input uses CommonJS modules

This commit is contained in:
NikolaBorislavovHristov 2019-04-17 15:18:46 +03:00
parent f8371bd44c
commit e76eb8a09f
2 changed files with 7 additions and 7 deletions

View file

@ -1,6 +1,6 @@
import React, { PureComponent } from 'react'; const React = require('react');
import PropTypes from 'prop-types'; const PropTypes = require('prop-types');
import { withFocusable } from 'stremio-common'; const withFocusable = require('../Focusable/withFocusable');
const ENTER_KEY_CODE = 13; const ENTER_KEY_CODE = 13;
const BUTTON_INPUT_TYPES = ['button', 'link', 'submit', 'checkbox']; const BUTTON_INPUT_TYPES = ['button', 'link', 'submit', 'checkbox'];
@ -16,7 +16,7 @@ const TAG_NAMES_FOR_TYPE = {
search: 'input' search: 'input'
}; };
class Input extends PureComponent { class Input extends React.PureComponent {
onKeyUp = (event) => { onKeyUp = (event) => {
if (typeof this.props.onKeyUp === 'function') { if (typeof this.props.onKeyUp === 'function') {
this.props.onKeyUp(event); this.props.onKeyUp(event);
@ -87,4 +87,4 @@ const InputWithForwardedRef = React.forwardRef((props, ref) => (
InputWithForwardedRef.displayName = 'InputWithForwardedRef'; InputWithForwardedRef.displayName = 'InputWithForwardedRef';
export default InputWithForwardedRef; module.exports = InputWithForwardedRef;

View file

@ -1,3 +1,3 @@
import Input from './Input'; const Input = require('./Input');
export default Input; module.exports = Input;