diff --git a/src/NewTask.tsx b/src/NewTask.tsx index 20ff03c..ee7d07d 100644 --- a/src/NewTask.tsx +++ b/src/NewTask.tsx @@ -21,16 +21,19 @@ const Form = ({ }, []); const modifiedChildren = useMemo(() => { - return children.map(child => { + return React.Children.map(children, child => { return React.cloneElement( - child + child, + { + updateData: handleData + } ) - }) - }, [children]) + }); + }, [children]); return ( - + {modifiedChildren} ); } diff --git a/src/app.tsx b/src/app.tsx index 6188ad8..b55629f 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -46,7 +46,7 @@ const App = () => { }, []); useEffect(() => { - mongoose.connect('mongodb://localhost', { + mongoose.connect('mongodb+srv://todo:todo@cluster0.phn2o.mongodb.net/myFirstDatabase?retryWrites=true&w=majority', { useNewUrlParser: true, useUnifiedTopology: true }).then(() => new Promise(res => setTimeout(res, 1000))).then(() => {