-
Notifications
You must be signed in to change notification settings - Fork 19
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
Refactor/class to func component #44
base: master
Are you sure you want to change the base?
Conversation
@a-x- can you help us review this? |
debug('init printable', this.props.name); | ||
const isSingle = (this.props.main || this.props.single); | ||
this.context.printProvider && this.context.printProvider.regPrintable(this.props.name, <Print {...this.props} />, isSingle); | ||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this useEffect should be componentDidMount equivalent, because, e.g. window.matchMedia('print').onchange must be called at once,
so, as I understand, we need add empty list of dependencies ([]
) here: useEffect(() => {...}, []);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, we need to verify all the useEffect
s' dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t think this influence the react devtool
I'll check the comments and suggestions and work on the changes later |
This comment has been minimized.
This comment has been minimized.
@a-x- any progress on this? anything we can do to help? |
@a-x- Hey, anything I can do to help to get this merged? Just let me know :) |
can we merge and release a new version? it would be cool to add some react-testing-library tests after this |
Closes #43