Add React component type annotations #791
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Many of our functional components had typed props, but did not type the entire component itself (this left the return value untyped). This PR types those components as
React.FC
, which implicitly adds the JSX element return type.Thanks to GPT-4.1 agent for completing this task in <1 minute ;)GPT missed a lot and eventually went in to a wild spiral of wrongness (including deleting huge chunks of code and claiming it was already like that) trying to complete the task. Claude finished the job just fine, but took a bit longer. Good tradeoff IMO.This PR may cause some conflicts for other open PRs, but I feel they will be simple conflicts to resolve as all changes are mechanical edits to existing function signatures. No behavior changes.
Checklist
Resolves #XXX
.Failing lint checks can be resolved with:
pre-commit run --all-files
jlpm run lint
📚 Documentation preview: https://jupytergis--791.org.readthedocs.build/en/791/
💡 JupyterLite preview: https://jupytergis--791.org.readthedocs.build/en/791/lite