Confirmé
19 août 2026

Trouve le bug : React Native

Un extrait de code. Trouve le bug, ou prouve qu'il n'y en a pas.

tsx
1import * as SQLite from 'expo-sqlite'
2
3const db = SQLite.openDatabaseSync('blog.db')
4
5type Post = { id: number; title: string; author_id: number }
6
7export async function loadPostsWithAuthors() {
8  const posts = await db.getAllAsync<Post>('SELECT id, title, author_id FROM posts')
9  const enriched = []
10  for (const post of posts) {
11    const author = await db.getFirstAsync(
12      'SELECT name FROM users WHERE id = ?',
13      post.author_id
14    )
15    enriched.push({ ...post, author })
16  }
17  return enriched
18}

Clique sur les lignes qui posent problème.

Ton verdict

Une tentative par jour. La réponse s'affiche juste après.

Garde ta série

Crée un compte pour conserver ta série et suivre ta progression.

Créer un compte