Move TodoItem from App.tsx to standalone types.ts
This commit is contained in:
parent
01cbf39684
commit
8473df7a16
@ -1,12 +1,7 @@
|
||||
import React, {useState} from 'react';
|
||||
import './App.css';
|
||||
import Todo from "./Todo";
|
||||
|
||||
interface TodoItem {
|
||||
id: number;
|
||||
text: string;
|
||||
completed: boolean;
|
||||
}
|
||||
import {TodoItem} from "./types";
|
||||
|
||||
function App() {
|
||||
const [todos, setTodos] = useState<TodoItem[]>([]);
|
||||
|
5
src/types.ts
Normal file
5
src/types.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export interface TodoItem {
|
||||
id: number;
|
||||
text: string;
|
||||
completed: boolean;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user