fix children

stable
Valerie 2021-08-23 14:11:04 -04:00
parent 74601f602e
commit 5588f04b7e
2 changed files with 9 additions and 6 deletions

View File

@ -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 (
<Box flexDirection="column">
{modifiedChildren}
</Box>
);
}

View File

@ -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(() => {