Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/components/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ export function CodeBlock({ code, lang }: { code: string, lang: BundledLanguage,
const [nodes, setNodes] = useState(undefined as JSX.Element | undefined)

useLayoutEffect(() => {
void highlight(code, lang).then(setNodes)
// Ignore the result if the code changed before it is ready.
let current = true
void highlight(code, lang).then((nodes) => current && setNodes(nodes))
return () => { current = false }
}, [code, lang])

return nodes ?? <p>Loading...</p>
Expand Down
2 changes: 1 addition & 1 deletion src/components/index/Install.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function TargetsView({}: Props) {
useEffect(() => {
const [command, lang] = installInstructions();
setInstructions([command, lang]);
});
}, []);

const [command, lang] = instructions;
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ core.write_32(0x2000_0000, &data)?;`,
<p>
We even have our own open-source probe to <a
href="https://github.com/probe-rs/rusty-probe">build</a
> or buy (coming soon)
> or buy.
</p>
</div>
<div class="lg:col-span-2">
Expand Down
Loading