client/src/components/SlateEditor/index.js
changeset 195 669b563563f5
parent 194 d19ba6045e82
equal deleted inserted replaced
194:d19ba6045e82 195:669b563563f5
   293 export default withNamespaces("", {
   293 export default withNamespaces("", {
   294   innerRef: (ref) => {
   294   innerRef: (ref) => {
   295     if(!ref) {
   295     if(!ref) {
   296       return;
   296       return;
   297     }
   297     }
   298     const wrappedRef = ref.getWrappedInstance();
   298     const editorRef = (ref && ref.props) ? ref.props.editorRef : null;
   299     const editorRef = (wrappedRef && wrappedRef.props) ? wrappedRef.props.editorRef : null;
       
   300     if(editorRef && editorRef.hasOwnProperty('current')) {
   299     if(editorRef && editorRef.hasOwnProperty('current')) {
   301       editorRef.current = wrappedRef;
   300       editorRef.current = ref;
   302     }
   301     }
   303   }
   302   }
   304 })(connect(mapStateToProps, null, null, { withRef: true })(SlateEditor));
   303 })(connect(mapStateToProps, null, null, { forwardRef: true })(SlateEditor));