fix: warnings

This commit is contained in:
cha0s 2022-03-20 13:11:02 -05:00
parent dbf30b8af1
commit d2ea259e96
2 changed files with 8 additions and 5 deletions

View File

@ -23,12 +23,14 @@ const ScriptComponent = ({
);
};
ScriptComponent.defaultProps = {};
ScriptComponent.defaultProps = {
path: '/',
};
ScriptComponent.displayName = 'ScriptComponent';
ScriptComponent.propTypes = {
path: PropTypes.string.isRequired,
path: PropTypes.string,
resource: PropTypes.string.isRequired,
};

View File

@ -18,15 +18,16 @@ const Code = ({
}) => (
<AceEditor
className={className}
name={name.replace(/[^a-zA-Z0-9]/g, '-')}
fontSize={fontSize}
height={height || `${code.split('\n').length}em`}
width="100%"
mode="javascript"
name={name.replace(/[^a-zA-Z0-9]/g, '-')}
onChange={(value, event) => onChange(event, value)}
setOptions={{useWorker: false}}
tabSize={2}
theme="monokai"
onChange={(value, event) => onChange(event, value)}
value={code}
width="100%"
/>
);