-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Maintenance: CreateAccount and CreateEncryptionKey to tsx #1755
Maintenance: CreateAccount and CreateEncryptionKey to tsx #1755
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
1059cef
to
220921f
Compare
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.
Overall LGTM! Would you mind taking a look at the one nitpick?
@@ -142,7 +152,9 @@ export default function CreateEncryptionKey({ | |||
<Input | |||
type={showPassword ? 'text' : 'password'} | |||
style={{ width: 300 }} | |||
onChange={e => setPassword(e.target.value)} | |||
onChange={(e: ChangeEvent<HTMLInputElement>) => |
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.
🥜 nitpick: we should be able to automatically infer this type from the InputProps
. If it's currently not happening: would you mind checking why? Maybe we're missing definition of onChange
.
Once we solve it in InputProps
, then we won't need to do this change anymore.
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.
Much better, thanks.
220921f
to
7aba017
Compare
// preventDownshiftDefault is a downshift.js property - they don't have types for it on the React event | ||
// Suggested way to make this work with typescript is to cast as any... https://github.com/downshift-js/downshift/issues/734 | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
(e as any).preventDownshiftDefault = true; |
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.
@MatissJanis Fixing the Input.tsx types gave us an issue on this Autocomplete component by downshift.
The issue was that "preventDownshiftDefault" is not on the React.FocusEvent<HTMLInputElement, Element> - and rightly so 🤪 .
It's a known issue with downshift's types, here's the github issue: downshift-js/downshift#734
The suggested workaround is to type it as "any" so that's what I've done here.
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.
Thanks! Very informative comment :)
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 think I just found a better way than (e as any). The types don't complain when I access it directly, like
e['preventDownshiftDefault'] = true;
I've seen that elsewhere in the autocomplete file, so I've updated with that.
…d for this code push
…r input.tsx. Fixed as per dropshift github issue
4dd1a1e
to
af935b6
Compare
Convert CreateAccount and CreateEncryptionKey components to TypeScript.
Relates to : #1483