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

EpubViewer doesn't re-render when 'epubOptions' & 'style' prop changes #3

Closed
WEEFAA opened this issue May 10, 2021 · 3 comments
Closed
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@WEEFAA
Copy link

WEEFAA commented May 10, 2021

Describe the bug
When passing a different value to epubOptions & style props, EpubViewer doesn't re-evaluate and render with the new props

To Reproduce
Steps to reproduce the behavior:

  1. Render simple viewer using the EpubViewer
  2. Pass the required props and both (epubOptions & style) props
  3. Make a toggle to change the value of epubOptions & style prop

Expected behavior
EpubViewer should re-render and display changes with the new passed in props

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Windows 10 Single Language 64-bit
  • Browser: Firefox
  • Version: 88.0.1

Additional context

        useEffect(() => {
             // some effect to change the value of props 
             setTimeout(() => {
                setBookOption({...})
                setBookStyle({...})
             },500)
          
             // should re-render the viewer after the delay
        },[]) 

	<EpubViewer
		ref={viewerRef}
		url={url}
		epubFileOptions={epubFileOptions}
		epubOptions={bookOption} // doesn't re-render
		style={bookStyle} // doesn't re-render
		rendtionChanged={renditionChange}
		loadingView={loadingView || <LoadingView />}
		bookChanged={onBookInfoChange}
		pageChanged={onPageChange}
		tocChanged={onTocChange}
		selectionChanged={onContextMenu}
	/>
@altmshfkgudtjr
Copy link
Owner

Hi!

I confirmed the issue.

First of all, I am sorry for the bug.

And I will check and fix the problem as soon as possible.

Thank you! 😀

@WEEFAA
Copy link
Author

WEEFAA commented May 10, 2021

Yes,

Thank you so much for your quick response. Giving you that HIGH FIVE on the form of a star.

Will wait for the fix!
Thanks again, 🐳! Excellent project nonetheless.

altmshfkgudtjr added a commit that referenced this issue May 15, 2021
Fixed a bug where re-rendering would not work when options and styles were changed.
@altmshfkgudtjr
Copy link
Owner

corrected this issue!

Thank you for trusting and waiting!

@altmshfkgudtjr altmshfkgudtjr added good first issue Good for newcomers bug Something isn't working labels Jan 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants