diff --git a/code/16-finished/.gitignore b/code/16-finished/.gitignore new file mode 100644 index 0000000000..3dc0a5dba7 --- /dev/null +++ b/code/16-finished/.gitignore @@ -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* diff --git a/code/16-finished/src/store/todos-context.tsx b/code/16-finished/src/store/todos-context.tsx index 334a2a0aa7..5bfd447709 100644 --- a/code/16-finished/src/store/todos-context.tsx +++ b/code/16-finished/src/store/todos-context.tsx @@ -14,7 +14,9 @@ export const TodosContext = React.createContext({ 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([]); const addTodoHandler = (todoText: string) => { diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000..da3d09de9f --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "react-complete-guide-code", + "lockfileVersion": 2, + "requires": true, + "packages": {} +}