lbry-desktop/ui/component/common/form-components/form.jsx

29 lines
509 B
React
Raw Permalink Normal View History

2018-03-26 23:32:43 +02:00
// @flow
import * as React from 'react';
type Props = {
children: React.Node,
onSubmit: any => any,
};
export class Form extends React.PureComponent<Props> {
render() {
const { children, onSubmit, ...otherProps } = this.props;
return (
<form
2019-09-26 18:07:11 +02:00
noValidate
2018-03-26 23:32:43 +02:00
className="form"
onSubmit={event => {
event.preventDefault();
onSubmit(event);
}}
{...otherProps}
>
{children}
</form>
);
}
}
export default Form;