Closed dukesx closed 2 years ago
This is the test sandbox : https://codesandbox.io/s/friendly-moon-xiltz?file=/pages/admin/articles/index.tsx
navigate to this url inside sandbox : https://xiltz.sse.codesandbox.io/admin/articles
then scroll to the bottom , you will see input , start writing inside "title" input , and see editors resetting their state. Look at the picture for reference
@dukesx Hi! First of all, thanks for your interest! 👋
I can't see codesandbox that error occurs. I think you should dynamic import used at the top of the file
Thanks!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have tried to avoid editor.js refreshing on every state change by using useRef instead of useState function. UseRef can change value but doesn't trigger re render. @Jungwoo-An the react component is very unstable. I have used editor.js with vanilla js implementation in useEffect and its not that unstable. It works normally with useState, it doesn't re render itself.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@dukesx Hi! First of all, thanks for your interest! 👋
I'm sorry for the late response. Do you still need my help?
Thanks!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@dukesx Hi, I've been working in project using this library. I'm not sure exactly where is your problem but maybe taking a look to my project will help you:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Environment
Describe
I am trying to save editor js data. How i am doing this right now :
Example:
Main.tsx file
Editor.tsx file
Issue
Every time my "Main" component state changes, it causes Editor to reset to its default value. This means that i can never save new data.
This is because, if parent component hook for example , useState changes, it triggers a re render, and because parent is re rendered, it causes the child component , Editor , to also re render, causing it to lose its state. Is there any work around ?