Skip to content
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

Sync with react.dev @ bbb08a5a #31

Merged
merged 17 commits into from
Apr 1, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix sandpack ts (#6498)
harish-sethuraman authored Dec 16, 2023
commit d0a50e8a973497a167b76ccf2baaf1eb1d431286
10 changes: 5 additions & 5 deletions src/content/learn/typescript.md
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ Taking the [`MyButton` component](/learn#components) from the [Quick Start](/lea

<Sandpack>

```tsx App.tsx active
```tsx src/App.tsx active
function MyButton({ title }: { title: string }) {
return (
<button>{title}</button>
@@ -88,7 +88,7 @@ This inline syntax is the simplest way to provide types for a component, though

<Sandpack>

```tsx App.tsx active
```tsx src/App.tsx active
interface MyButtonProps {
/** The text to display inside the button */
title: string;
@@ -170,7 +170,7 @@ The [`useReducer` Hook](/reference/react/useReducer) is a more complex Hook that

<Sandpack>

```tsx App.tsx active
```tsx src/App.tsx active
import {useReducer} from 'react';

interface State {
@@ -248,7 +248,7 @@ The type of the value provided by the context is inferred from the value passed

<Sandpack>

```tsx App.tsx active
```tsx src/App.tsx active
import { createContext, useContext, useState } from 'react';

type Theme = "light" | "dark" | "system";
@@ -381,7 +381,7 @@ When working with DOM events in React, the type of the event can often be inferr

<Sandpack>

```tsx App.tsx active
```tsx src/App.tsx active
import { useState } from 'react';

export default function Form() {