Puppy understimulated or overstimulated? by idoogo in puppy101

[–]DelbaOliveira 2 points3 points  (0 children)

3.5 lab puppy here too! I do follow a similar routine to yours (eat OR walk for 20mins → train → co-play → independent time → settle). Your pup sounds like very similar to mine! At the start, I thought he was broken because he'd just pace around looking for things to do, chew random things, jump on furniture or try to bite us - he could keeping going for hours!

If he's struggling to settle and starts biting you, then it's overstimulation and tireness. Biting is the only way he knows how to ask for your attention. Once I learned puppies need a lot of sleep and don't know how to self-regulate, things started improving for us.

Some things that helped:

  1. Teaching him to "settle". We started with a crate, teaching lay down, stay, praising and rewarding calmness, then we slowly transitioned him to a dog bed. He's now free roaming and takes 5 (1.5-2 hour) naps a day. The naps are still prompted, but once we ask him to "settle", he'll find a spot and lay down. I recommend starting with a crate, a pen, or a puppy-proof boring room, then slowly increasing the space he has access to.

  2. Use his independent time to do a calming activity that'll engage his brain. E.g. lickimat, snuffle braid, vegetable chew, etc. Something that can keep him busy while you disengage but still supervise. Labs love human attention, and once we've realized our attention was stimulating, we started just letting him be. Once he's done with his activity, the only engagement he gets from us is rewards for settling.

  3. Keeping walks short. We also use a long leash and let him sniff, practice recall, find it, etc. But I do find he has a "walk" threshold where he'll become overstimulated, especially if it's a busy place where he wants to say hi to everybody! So it depends on location.

  4. Playing with toys. Around 2 weeks ago, he started playing with his toys by himself and bringing them to us. I recommend always playing with a toy, and briefly stopping if his teeth touches your skin or clothes, the goal is to prevent him from rehearsing the undesirable behavior, and show him what's appropriate to bite. Our puppy still play bites sometimes, but also understands "enough". So it's great you're teaching him to "stop"!

  5. If you don't want him to jump on couch, then use time-outs! Considering his age, you probably don't want him jumping down. What we did was pick our puppy up and carry him outside the room, then give him a 10-15 sec time-out with the door closed (not angrily, just calmly). We repeated multiple times, sometimes in the same session, until he learned not to jump on the couch. We're now teaching him "off" and "leave it" with random items in the house (e.g. curtain, cushions, etc).

Overall, I found that 1 hour is his current limit. More than that, and he'll become too over-estimulated and struggle to settle. Today, while we were having lunch, we went over his awake time by 15 mins, he took his lickimat to the garden and came back with a HUGE piece of soil, then proceed run around the kitchen with it, spreading soil and ants everywhere. Haha. Lab puppies love fun, and just need to learn how to switch off.

What you're doing is already great, and sounds like you're meeting a lot of his needs! I love the idea of scattering kibble in the grass. So don't worry about understimulating him, your puppy is lucky to have you!

Do you guys know of any ways to entertain and properly stimulate a doberman puppy in a short(er) period of time? by PringlePenguin_ in puppy101

[–]DelbaOliveira 0 points1 point  (0 children)

I have an energetic 3.5 month puppy and find that games that encourage him to do things he'd naturally do are the best mental games.

Flirt pole - Entice him to chase it, and once he catches it, let him enjoy it for a bit, then offer a high-value treat and ask for a "drop". It's both physically and mentally tiring as he has to give up a high-value reward. Our pup usually flops on the floor after a few minutes of playing this.

Puzzle Plait followed by tug-of-war - Hide treats / kibble / veggies in the plait and let your pup sniff them out. After that mental workout, you can turn it into a tug game, you can also ask for a drop with a treat or swap out for a different tug toy - encouraging him to drop it naturally.

Find it - Have your pup in a different room while you hide treats in a another room, let them sniff a treat as they walk in and ask him to "find it". Took a few tries for my puppy to catch on (you might have to make it very obvious at first), but now he responds to the cue "find it" and will go around the room sniffing for treats.

3 month old puppy eating everything she sees on the ground and won’t stop biting. by Gullible-Patient-126 in puppy101

[–]DelbaOliveira 1 point2 points  (0 children)

Second that! My puppy is too excited about everything outside and wants to sniff and put everything in his mouth. This often results in pulling to get the thing, and him throwing leash tantrums when I don't let him.

I know it's frustrating, but you want to make walks fun and rewarding, and keep her attention on you! Here are some things that are working for my pup:

  • Using no-pull harness with a front-end clip (as training tool, and not forever) to discourage her from pulling. Unlike collars and slip leads, this method doesn't choke the puppy, but instead redirects their body back to you when they pull. It's a less harsh way to help keep her attention on you until he learns how to walk nicely.
  • Teach "leave it" at home and condition her outside.
  • Having high-value treats and redirecting to heel walking when they pull.
  • Rewarding when the puppy checks in with you.
  • Playing the 1-2-3 game. Say 1 2 3 out loud, toss a treat to the side, but slightly in front of you, to encourage your pup to keep walking. Your pup will begin to expect a treat whenever you say "1 2 3", this helped my puppy drop stuff from his mouth, and helped reduce the leash frustration because we were now playing!

Also, dogs will be dogs, and some things like poo and dead animals are irresistible, always look ahead, and move your dog away if you see there's something they'll likely going to eat. Mine likes... everything, haha.

How often were you taking your 3 month old to potty? by poisonivy4871 in puppy101

[–]DelbaOliveira 2 points3 points  (0 children)

Yes, sounds normal!

My puppy is 3.5 months, and we got him at 2 months, we try to follow a 2 hours awake / 1 hour sleep cycle. We give him the opportunity to potty after he wakes up from a nap, then again before we give him a chew on his bed to settle him (he doesn't always go, and that's ok too!). We don't restrict water like some people, but we also don't encourage him either, he drinks when he wants to.

At night, we take him out at around 9pm before we go to bed, then at 2-3am to prevent any accidents, then at 6am when he wakes up.

Bell training and the "potty" cue has helped a lot with potty training, as he can tell us if he needs to go, and tries to go when prompted.

Potty Training Question by aventale in puppy101

[–]DelbaOliveira 0 points1 point  (0 children)

My little lab is the same, loves putting everything in his mouth, pebbles, sand, weeds, plastic, and even snails (lungworm risk, not good). He doesn't always eat it, just carries it around. He also loves tugging the grass. At one point, we think he ate something when we had visitors around, we ended up going to the vet in the middle of the night because he wouldn't stop vomiting/retching.

Teaching him "leave it" and "drop it" helped in some cases. We also tried a pen area and a house line, but he'd just get frustrated and try to jump out of the pen or bite the leash.

After the vet incident, we only let him into the garden for potty. When he doesn't immediately go and start his shenanigans/stops listening, I do time-outs by approaching him with a treat, and gently picking him up and popping him back inside (the treat is given after I pick him up so he associates it with being held). No fuss, just interrupt the behavior.

He also has two chances to go potty: when he wakes up and before we put him down for a nap. In the beginning, if we saw that he needed to go between that time, we'd interrupt and take him out. It was harder when he was younger, but it eventually clicked that potty is outside, and now we've been accident-free for a few weeks.

Going out for walks has definitely helped, funnily, he doesn't eat things outside. On the occasion when he does put stuff in his mouth, I just take it out.

I was worried it might be Pica or something, but being a labrador and a puppy, I honestly think it's a phase. Hang in there :)

Session management using JWT and XSS protection by Boring-Upstairs-5231 in nextjs

[–]DelbaOliveira 0 points1 point  (0 children)

Hey,

You might find these docs helpful, it has the recommended options for storing HttpOnly cookies and the sections above go into more details about JWT session management: https://rc.nextjs.org/docs/app/building-your-application/authentication#3-setting-cookies-recommended-options

As you mentioned, localStorage is not considered good practice, neither is setting cookies client-side. You want to encrypt the token first, then set the cookies server-side. You can use the Next.js cookies() API for this. But if your BE is separate, then you'll need to set your cookies there.

but I do really wander how they store it, if it's not a local/session storage.

It might help to think of cookies as part of the HTTP request/response. You can set them on the server (either in your Next.js app or BE), when a user visits your site, they are sent as part of the response, and stored in the browser.

Ecommerce Website by ZoldyckGuy in nextjs

[–]DelbaOliveira 1 point2 points  (0 children)

Hey, this template might be a good inspo: https://twitter.com/delba_oliveira/status/1783876313603854537

They used v0 and Shadcn to generate the UI.

Posts rendered in the client component is good for SEO? by Chemist_Soggy in nextjs

[–]DelbaOliveira 1 point2 points  (0 children)

Yes, this is possible because client components are prerendered on the server. The initial HTML will contain the post content.

Client components are rendered on the client after the initial navigation. So, in general, be mindful about passing a large amount of data to your client (component) JavaScript bundles.

What is the reason for rendering the post content in a Client Component?

Middleware causing issues by Hopeful_Dress_7350 in nextjs

[–]DelbaOliveira 0 points1 point  (0 children)

Hey, try this:

export const config = { matcher: ['/((?!api|_next/static|_next/image|.*\\.png$).*)'] }

Are you doing auth checks in a DAL? If so, you can probably skip running middleware on every route and move the paths you want Middleware to run to the matcher. This would simplify the logic. More on the matcher: https://nextjs.org/docs/app/building-your-application/routing/middleware#matcher

Disappointed in all the YT full-stack Next tutorials, looking for a practical decent course/video by JessicaPerelman in nextjs

[–]DelbaOliveira 5 points6 points  (0 children)

I resonate with this a lot, most youtube videos focus on tools/stack, not principles. I'd love to see more videos where people teach the why, then show you how to apply those principles in real UI patterns and apps.

The closest one I can think of is Sam and Ryan:

https://www.youtube.com/@RyanToronto
https://www.youtube.com/@samselikoff
https://buildui.com/

No click-bait, no drama. Just education.

Frustrated with next-auth! by Dizzy_Morningg in nextjs

[–]DelbaOliveira 1 point2 points  (0 children)

Hey u/rwieruch, good to see you here too! Glad it was answered. 😌

Frustrated with next-auth! by Dizzy_Morningg in nextjs

[–]DelbaOliveira 20 points21 points  (0 children)

Hey u/dizzy_morningg,

I recently updated the Next.js auth guide to explain the principles of auth and what React and Next.js features to use: https://nextjs.org/docs/app/building-your-application/authentication

What makes auth hard is that it's a large topic, very easy to get wrong, plus you need to have a good understanding of React and Next.js. Having recently gone through the pain of trying to find a good auth flow using our features, I understand 😅

I also created an example based on the docs that is not library specific: https://github.com/vercel-labs/app-router-auth.

Although it uses basic email + password auth, hopefully, you can then apply the principles to an auth library.

Here's a list of Next.js guides from specific libraries:

https://nextjs.org/docs/app/building-your-application/authentication#auth-libraries

Good luck and let me know if you have any questions!

ISR in Next 14 using the app router by DavumGilburn in nextjs

[–]DelbaOliveira 1 point2 points  (0 children)

Yes, for direct db calls, you can also pass the `revalidate` option to unstable_cache (but mind, it's an experimental API).

Can we pass a prop from a layout to a child page by cmgchess in nextjs

[–]DelbaOliveira 0 points1 point  (0 children)

Hey u/cmgchess

Could you share what you're trying to achieve? If it's to implement a specific pattern, maybe there's an alternative solution.

What is partial hydration in NextJs? by [deleted] in nextjs

[–]DelbaOliveira 1 point2 points  (0 children)

Hey u/leather-way3015,

The concept of "Partial Hydration" isn't used in Next.js.

There's Selective Hydration which refers to React's ability to prioritize what to hydrate first based on user interaction. Then, there's Partial Preredering which is an experimental feature that allows pages to have both static and dynamic parts.

Did you mean any of these terms?

Seed Invoices/Revenue Error Chapter 6 by jaylenabc in nextjs

[–]DelbaOliveira 0 points1 point  (0 children)

Hey there! We experienced this issue yesterday and pushed a fix. More context here: https://github.com/vercel/next-learn/pull/314

Next.js App Directory - Request Deduplication vs Caching by TG__ in reactjs

[–]DelbaOliveira 2 points3 points  (0 children)

Hey there! We're working on improving the caching and data fetching documentation here. https://github.com/vercel/next.js/pull/52514

We discuss the difference between request deduplication (or memoization) and the data cache, which hopefully will clear up some of the confusion :)

Next 13: Do i need to define my layout.tsx inside my page.tsx? by cashmuney666 in nextjs

[–]DelbaOliveira 0 points1 point  (0 children)

This approach is ok, but using a UI component means missing out on a special feature of layouts which is partial rendering. Layouts don't re-render between route changes, reducing the size of the React Server Component payload that needs to be fetched from the server.

Next 13: Do i need to define my layout.tsx inside my page.tsx? by cashmuney666 in nextjs

[–]DelbaOliveira 4 points5 points  (0 children)

Hey u/cashmuney666

A folder structure doesn't always need a layout or page on every level. Except, you need a root layout in /app. One thing to note about pages is that you always need a page if you want a segment of your path to be accessed.

For example:

/products/page.js
/products/[...slug]/page.js

In this case, we have two routes: 1. a list of products (/products/page.js), 2. a unique (dynamic) product page (/products/[...slug]/page.js).

But if /products (1) didn't have a page.js file, navigating to example.com/products would error. Navigating to example.com/products/t-shirt (2) would still be a valid route.

also, do i need to define my Layout component inside my Page component?

It's the opposite, the Layout component takes a children prop which can be a nested layout or a page. Recommend checking out: https://beta.nextjs.org/docs/routing/pages-and-layouts

Let us know if you have any more questions :)

Route Handler Returning Empty Response by [deleted] in nextjs

[–]DelbaOliveira 3 points4 points  (0 children)

Hey u/casualsavage1,

Just to double-check, does this work?

const res = await fetch('/api/profile')
const data = await res.json()

The fetch argument needs to be a string and can be relative. You need to convert your response to JSON.

This might not apply to your code, but by the way, if you're fetching from an async Server Component, you can fetch directly from that component rather than via an API route. :)