Skip to content

Port components to ts 4 #2723

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Port components to ts 4 #2723

wants to merge 8 commits into from

Conversation

RoyEJohnson
Copy link
Contributor

@RoyEJohnson RoyEJohnson commented Apr 1, 2025

() => new Intl.DisplayNames([language], {type: 'language'}),
[language]
const text = React.useMemo(
() => (new Intl.DisplayNames([language], {type: 'language'})).of(locale),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't support browsers so old that Intl.DisplayNames isn't supported, so I took the fallback out.

@@ -41,7 +49,7 @@ export function Paginated({children, perPage=10}) {
}
useEffect(() => {
if (pageChanged) {
$.scrollTo(ref.current, 70);
$.scrollTo(ref.current as HTMLDivElement, 70);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you want to check for current being set before calling this? I checked the helper and it doesn't check for a null param so it seems like this could cause issues...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand it, when the useEffect runs, the ref will be set, since it's set in the return value for the component. If I do a test for not-set, I won't be able to cover that branch with testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added an assertNotNull helper function.

@RoyEJohnson RoyEJohnson force-pushed the port-components-to-ts-4 branch from a8d3c58 to 9d295f0 Compare May 1, 2025 22:00
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.

2 participants