Skip to content
Open
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
25 changes: 25 additions & 0 deletions code/16-finished/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.DS_Store
.vscode
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
4 changes: 3 additions & 1 deletion code/16-finished/src/store/todos-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export const TodosContext = React.createContext<TodosContextObj>({
removeTodo: (id: string) => {},
});

const TodosContextProvider: React.FC = (props) => {
// In React 18.x you have to include the children prop yourself, I wrote solution below

const TodosContextProvider: React.FC<{ children: JSX.Element | JSX.Element[] }> = (props) => {
const [todos, setTodos] = useState<Todo[]>([]);

const addTodoHandler = (todoText: string) => {
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.