mirror of
https://github.com/vale981/Vulcan
synced 2025-03-04 17:21:37 -05:00
formElement must be a class component to accept a ref
This commit is contained in:
parent
7cfaac2450
commit
339215e6f3
1 changed files with 7 additions and 1 deletions
|
@ -1,7 +1,13 @@
|
|||
import React from 'react';
|
||||
import { registerComponent } from 'meteor/vulcan:core';
|
||||
|
||||
const FormElement = ({children}) => <form>{children}</form>;
|
||||
// this component receives a ref, so it must be a class component
|
||||
class FormElement extends React.Component {
|
||||
render(){
|
||||
const { children, ...otherProps } = this.props;
|
||||
return <form {...otherProps}>{children}</form>;
|
||||
}
|
||||
}
|
||||
registerComponent({
|
||||
name:'FormElement',
|
||||
component: FormElement
|
||||
|
|
Loading…
Add table
Reference in a new issue