fix children
parent
74601f602e
commit
5588f04b7e
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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(() => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue