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

Refactor/class to func component #44

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

Vitao18
Copy link

@Vitao18 Vitao18 commented Nov 9, 2019

Closes #43

src/Print.jsx Outdated Show resolved Hide resolved
src/PrintProvider.jsx Outdated Show resolved Hide resolved
@sibelius
Copy link

@a-x- can you help us review this?

src/PrintProvider.jsx Outdated Show resolved Hide resolved
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(() => {
Copy link
Owner

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(() => {...}, []);

Copy link
Owner

@a-x- a-x- Nov 23, 2019

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 useEffects' dependencies

Copy link

@sibelius sibelius left a 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

src/Print.jsx Outdated Show resolved Hide resolved
src/PrintProvider.jsx Outdated Show resolved Hide resolved
src/PrintProvider.jsx Outdated Show resolved Hide resolved
@a-x- a-x- marked this pull request as ready for review November 23, 2019 15:10
@Vitao18
Copy link
Author

Vitao18 commented Nov 23, 2019

I'll check the comments and suggestions and work on the changes later
Thanks for the valuable input, very glad to help

@a-x-

This comment has been minimized.

@sibelius
Copy link

sibelius commented Feb 3, 2020

@a-x- any progress on this?

anything we can do to help?

@Vitao18
Copy link
Author

Vitao18 commented Jun 24, 2020

@a-x- Hey, anything I can do to help to get this merged?
I'll check the refactor again to see if there's something missing

Just let me know :)

@sibelius
Copy link

can we merge and release a new version?

it would be cool to add some react-testing-library tests after this

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

Successfully merging this pull request may close these issues.

make it work in strict mode
3 participants