title: Why i Can not use Props directly in SunEditor component, it's showing previous render data?
body: <p>I am passing props in component and using directly in suneditor..</p>
  <pre><code>const SunEditorForRendering: React.FC&lt;Props&gt; = ({postContent }) =&gt; {
  const [content, setContent] = useState(&quot;hello world&quot;);
  
      const editor = useRef&lt;SunEditorCore&gt;();
    // The sunEditor parameter will be set to the core suneditor instance when this function is called
    const getSunEditorInstance = (sunEditor: SunEditorCore) =&gt; {
      editor.current = sunEditor;
    };
  
  
   useEffect(() =&gt; {
      if (postContent) {
        editor.current?.core.setContents(postContent);
      }
    }, [postContent]);
  
           &lt;SunEditor
            getSunEditorInstance={getSunEditorInstance}
            //setContents={content}
            setContents={postContent}
            onChange={handleOnChange}
         
          /&gt;
  }
   
  </code></pre>
  <p>Above code does not work as expected and content of editor is stale many times. But if i do not use postcontent directly and first save it in a state and then set state to editor , it works correctly.
  Working code is</p>
  <pre><code>const SunEditorForRendering: React.FC&lt;Props&gt; = ({postContent }) =&gt; {
  const [content, setContent] = useState(&quot;hello world&quot;);
  
      const editor = useRef&lt;SunEditorCore&gt;();
    // The sunEditor parameter will be set to the core suneditor instance when this function is called
    const getSunEditorInstance = (sunEditor: SunEditorCore) =&gt; {
      editor.current = sunEditor;
    };
  
  
   useEffect(() =&gt; {
      if (postContent) {
       setContent(postContent);//----&gt; first save postcontent to new state
      }
    }, [postContent]);
  
  
  useEffect(() =&gt; {
      if (content) {
        editor.current?.setContents(content)//---&gt; here set content to editor
      }
    },[content]);
  
           &lt;SunEditor
            getSunEditorInstance={getSunEditorInstance}
            setContents={content}
            onChange={handleOnChange}
  
          /&gt;
  }
  </code></pre>
  <p>There are other code also , but they are same in both of the situations described above</p>