Skip to content

Fix TypeScript errors in recipes/sharing-state.mdx#14216

Merged
ArmandPhilippot merged 2 commits into
mainfrom
armand/fix-sharing-state-recipe
Jul 10, 2026
Merged

Fix TypeScript errors in recipes/sharing-state.mdx#14216
ArmandPhilippot merged 2 commits into
mainfrom
armand/fix-sharing-state-recipe

Conversation

@ArmandPhilippot

Copy link
Copy Markdown
Member

Description (required)

Follow-up of #14089. TL;DR: Improve UX by preventing the appearance of red squiggles (TS) and visual changes (formatting with Astro extension) when the user copies and pastes a code snippet.

  • Fixes TypeScript errors in recipes/sharing-state.mdx: getElementById() can return null. In the first snippet, the optional chaining operator is enough. In the second snippet, because we assign a new style, we need to wrap it with an if statement.
  • Formats updated code snippets (new project, Astro extension enabled)

References

@ArmandPhilippot ArmandPhilippot added the code snippet update Updates a code sample: typo, outdated code etc. label Jul 10, 2026
@astrobot-houston

astrobot-houston commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/recipes/sharing-state.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

Preview deployment

✅ Deployment complete!

@yanthomasdev yanthomasdev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Good work!

@ArmandPhilippot ArmandPhilippot merged commit 464666c into main Jul 10, 2026
9 checks passed
@ArmandPhilippot ArmandPhilippot deleted the armand/fix-sharing-state-recipe branch July 10, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code snippet update Updates a code sample: typo, outdated code etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants