react-doc-viewer
react-doc-viewer copied to clipboard
`shouldForwardProp` should be used for passing transient props in styled-components
While rendering PDF document, we get:
console warning:
styled-components: it looks like an unknown prop "last" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via"<StyleSheetManager shouldForwardProp={...}>" (connect an API like "@emotion/is-prop-valid") or consider using transient props ("$" prefix for automatic filtering.)
console error:
Warning: Received "true" for a non-boolean attribute "last".
Solution:
shouldForwardProp
(https://styled-components.com/docs/api#shouldforwardprop) should be used for passing transient props
The current problem is in:
PDFSingePage
line 23 where last
prop is being passed to PageWrapper
I'm also encountering this issue.
Any update on this issue?
shouldForwardProp
(https://styled-components.com/docs/api#shouldforwardprop) should be used for passing transient props
I think know its related to line 44 but can not figure out how to solve it. I have tried but not success:
return (react_1.default.createElement(PageWrapper, { id: "pdf-page-wrapper", last: _pageNum >= numPages },
return (react_1.default.createElement(PageWrapper, { id: "pdf-page-wrapper", shouldForwardProp: (prop)=> prop !== 'last', last: _pageNum >= numPages },