wrong way
const updatedData = await UserModel.findOneAndUpdate(
{ _id: userId, datas: { $elemMatch: { dataId: dataId } } },
{
$set: { "datas.$": dateToUpdate },
},
);
right way
wrong way
const updatedData = await UserModel.findOneAndUpdate(
{ _id: userId, datas: { $elemMatch: { dataId: dataId } } },
{
$set: { "datas.$": dateToUpdate },
},
);
right way
const [positionButtonDynamic, setPositionButtonDynamic] = useState('bottom-23');
const [scrollTop, setScrollTop] = useState(0);
useEffect(() => {
const onScroll = e => setScrollTop(e.target.documentElement.scrollTop);
window.addEventListener("scroll", onScroll);
return () => window.removeEventListener("scroll", onScroll);
Um pouco dos conceitos que é esperado você dominar de js antes de ir para o react
{ | |
"workbench.iconTheme": "material-icon-theme", | |
"workbench.startupEditor": "none", | |
"git.confirmSync": false, | |
"git.autofetch": true, | |
"editor.minimap.enabled": false, | |
"diffEditor.ignoreTrimWhitespace": false, | |
"editor.inlineSuggest.enabled": true, | |
"github.copilot.enable": { | |
"*": true, |
element1 { | |
margin-top: 15px; | |
margin-right: 10px; | |
margin-bottom: 25px; | |
margin-left: 35px; | |
} | |
/*or*/ | |
element2 { margin: 15px 10px 25px 35px } |
git checkout
(git config --global alias.ck checkout)git branch
(git config --global alias.br branch)git commit
(git config --global alias.co commit)git status
(git config --global alias.st status)git pull
(git config --global alias.pl pull)git push
(git config --global alias.ps push)tutorial config: https://www.atlassian.com/br/git/tutorials/git-alias
Also check Docker Learning Path and Lambda Learning Path
https://www.oreilly.com/library/view/apprenticeship-patterns/9780596806842/ch04.html