-
Hello TypeScript + React + Zustand + Axios!
-
- {/* Zustand 计数器示例 */}
-
-
Counter: {count}
-
-
-
-
-
-
-
- {/* Axios API 示例 */}
-
-
Sample Todos
- {loading &&
Loading...
}
- {error &&
{error}
}
- {!loading && !error && (
-
- {todos.map((todo) => (
- -
- {todo.title}
-
- ))}
-
- )}
-
-
- );
-}
-
-// 使用React 18+的createRoot API
-const rootElement = document.getElementById('root');
-if (rootElement) {
- const root = ReactDOM.createRoot(rootElement);
- root.render(
-