Closed heltena closed 2 years ago
This PR fixes the disappearing markdown view in my project with the currently released version! Thanks @heltena! @gonzalezreal can you please have a look and merge it if it's ok for you?
Hi,
Thanks for having a look at this. I am trying to find the root cause for the bug, that is, why the state changes to notRendered
. Changing ObservedObject
to StateObject
is not fixing the bug, only hiding it.
The problem I saw was that, using ObservedObject, init is called when the view is rendered, setting the state to "notRendered". Using StateObject, the view controls the object life properly, avoiding the init call.
Hey @heltena,
I have fixed the issue with a different approach (#83), considering other uses cases of the library (see the Dingus example, for instance). Notice that the fix is in the release-1.0
branch, together with other breaking changes I am making for the 1.0 release, which is still a work in progress.
It looks like the Markdown.store.state changes to "notRendered" at some point.