File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -99,11 +99,6 @@ class Webform extends Component {
9999
100100 this . key = props . form . form_id ;
101101
102- /**
103- * @var {Form}
104- */
105- this . formStore = this . getFormstore ( props ) ;
106-
107102 this . onSubmit = this . onSubmit . bind ( this ) ;
108103 this . converted = this . converted . bind ( this ) ;
109104 this . submit = this . submit . bind ( this ) ;
@@ -115,6 +110,13 @@ class Webform extends Component {
115110 if ( GTM ) {
116111 GoogleTag . addTag ( GTM ) ;
117112 }
113+
114+ // TODO: create formStore in willMount to support SSR
115+ /**
116+ * @var {Form}
117+ */
118+ this . formStore = this . getFormstore ( this . props ) ;
119+ this . forceUpdate ( ) ;
118120 }
119121
120122 componentWillReceiveProps ( nextProps ) {
@@ -226,6 +228,7 @@ class Webform extends Component {
226228 }
227229
228230 render ( ) {
231+ if ( ! this . formStore ) return null ;
229232 const formElements = this . getFormElements ( ) ;
230233 const multipage = this . isMultipage ( ) ;
231234
You can’t perform that action at this time.
0 commit comments