Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Conform more of the codebase to strictNullChecks #10573

Merged
merged 2 commits into from
Apr 13, 2023
Merged

Conversation

t3chguy
Copy link
Member

@t3chguy t3chguy commented Apr 12, 2023

Requires matrix-org/matrix-js-sdk#3271
For element-hq/element-web#21967


This change is marked as an internal change (Task), so will not be included in the changelog.

@t3chguy t3chguy added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label Apr 12, 2023
@t3chguy t3chguy marked this pull request as ready for review April 12, 2023 10:30
@t3chguy t3chguy requested a review from a team as a code owner April 12, 2023 10:30
@t3chguy t3chguy self-assigned this Apr 12, 2023
@@ -41,9 +41,9 @@ const CreateSubspaceDialog: React.FC<IProps> = ({ space, onAddExistingSpaceClick

const [busy, setBusy] = useState<boolean>(false);
const [name, setName] = useState("");
const spaceNameField = useRef<Field>();
const spaceNameField = useRef() as RefObject<Field>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to cast it ? An issue between MutableRefObject and RefObject ?

Copy link
Member Author

@t3chguy t3chguy Apr 12, 2023

Choose a reason for hiding this comment

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

Indeed, plus we don't really want to encourage manual mutation, it should be managed entirely by React and only accessed by us. But yeah without it React + Typescript don't fit the type properly

image

For some reason MutableRefObject always allows undefined - RefObject always null - things don't seem quite right

@t3chguy t3chguy merged commit 605ef08 into develop Apr 13, 2023
@t3chguy t3chguy deleted the t3chguy/tsc-strict123 branch April 13, 2023 07:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants