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

GH-2171: Add Missing Page Title to Upgrade Plan Hub Page #604

Merged
merged 6 commits into from Sep 21, 2020

Conversation

@fcjr
Copy link
Member

@fcjr fcjr commented Sep 17, 2020

  • Have you followed the guidelines in CONTRIBUTING.md?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you added an explanation of what your changes do?
  • Does your submission pass tests?
  • Did you lint your code prior to submission?
fcjr added 2 commits Sep 17, 2020
@fcjr fcjr requested review from benstrumeyer and ghostery/extension as code owners Sep 17, 2020
@fcjr fcjr changed the title Add Missing Page Title to Upgrade Plan Hub Page GH-2171: Add Missing Page Title to Upgrade Plan Hub Page Sep 17, 2020
Copy link
Contributor

@benstrumeyer benstrumeyer left a comment

LGTM

@fcjr fcjr requested a review from christophertino Sep 18, 2020
@wlycdgr
Copy link
Member

@wlycdgr wlycdgr commented Sep 18, 2020

Nice spot. If we want to avoid setting this on every render without reverting to using a class component, we can use the useEffect hook:

useEffect(() => {
  document.title = 'Ghostery is cool';
}, []);

The empty array second argument makes it so that the effect is only run once instead of after every render: https://reactjs.org/docs/hooks-effect.html#tip-optimizing-performance-by-skipping-effects

(No new packages need to be installed to use hooks, we should just be able to do import React, { useEffect } from 'react' since we are using React 16.13 and they've been supported since 16.8)

fcjr added 2 commits Sep 18, 2020
…to hub_title
@fcjr
Copy link
Member Author

@fcjr fcjr commented Sep 18, 2020

Nice spot. If we want to avoid setting this on every render without reverting to using a class component, we can use the useEffect hook:

useEffect(() => {
  document.title = 'Ghostery is cool';
}, []);

The empty array second argument makes it so that the effect is only run once instead of after every render: https://reactjs.org/docs/hooks-effect.html#tip-optimizing-performance-by-skipping-effects

(No new packages need to be installed to use hooks, we should just be able to do import React, { useEffect } from 'react' since we are using React 16.13 and they've been supported since 16.8)

Nice! Looks to be working for me, updated to use this.

@christophertino christophertino added this to the 8.5.3 milestone Sep 21, 2020
@christophertino christophertino merged commit 30a0d04 into develop Sep 21, 2020
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@christophertino christophertino deleted the hub_title branch Sep 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants