Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the "proper" way to re-initialise redoc element? #167

Closed
rbywater opened this issue Dec 18, 2016 · 4 comments
Closed

What's the "proper" way to re-initialise redoc element? #167

rbywater opened this issue Dec 18, 2016 · 4 comments

Comments

@rbywater
Copy link

I've been working on a spec viewer which uses ReDoc to render the spec documentation. Basically the page has a list of files and as you select a file from the list, the page dynamically updates to have the documentation of that page without having to refresh the page.

I've found that once you have done a Redoc.init(), further attempts fail. So what I've been doing in the meantime is, when I want to refresh the spec being displayed, I replace the Redoc DOM node with a fresh <redoc/> tag and that allows Redoc.init() to work. This seems to work but there is also a bunch of errors about "Attempt to use a destroyed view" that get spat out into the console. Its not stopping the rendering from actually happening but its always good to keep the console logs clean if posssible.

Therefore is there a more "proper" way of doing a second Redoc.init() on a page? Could Redoc.init() be changed on subsequent calls to destroy everything and start again?

@RomanHotsiy
Copy link
Member

@rbywater actually this is a bug. I will fix it for the next release.
It is planned for today

@RomanHotsiy
Copy link
Member

I will release a new package with the issue fixed in 4-5hours
I will let you know

@RomanHotsiy
Copy link
Member

@rbywater new version 1.6.3 is available

@rbywater
Copy link
Author

👍 Just tried it and no more console errors being thrown as far as I can tell.

Thanks for the prompt response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants