←
Aaron Pavlick57 posts
Aaron Pavlick avatar

Aaron Pavlick

@apav_dev

FDE @ Alpha FMC

◷ Joined November 2021▧ 12 Photos and videos
Jon Meyers avatar
⟳ Aaron Pavlick retweeted
Jon Meyers@jonmeyers_io·10 Jul 2023

Turns out it was never an issue! 🚀 Just a misalignment of my mental model for how this works. I wrote an article to help clear it up for others 👍 jonmeyers.io/blog/forwarding…

Aaron Pavlick avatar
Aaron Pavlick@apav_dev·3 Apr 2023

Then I can add the handleScroll function as a dependency to another useEffect hook to keep my scroll event listener up to date:

Post attachment
Aaron Pavlick avatar
Aaron Pavlick@apav_dev·3 Apr 2023

Adding searchLoading as a dependency to the hook kept there from being multiple fetches to the Search API when reaching the bottom of the page. Here's the complete function:

Post attachment
Aaron Pavlick avatar
Aaron Pavlick@apav_dev·3 Apr 2023

When I first added my handleScroll function as an event listener, the function was always using the same offset value and grabbing the same page of results over and over again. The solution here was to "close over" the search state with the useCallback hook

Aaron Pavlick avatar
Aaron Pavlick@apav_dev·3 Apr 2023

Someone recently asked me about implementing infinite scroll with @yext's Search UI React library. Putting the sample code together was a nice little React lesson 🧵

Jason Fleetwood-Boldt avatar
⟳ Aaron Pavlick retweeted
Jason Fleetwood-Boldt@jaflebol·14 Mar 2023

I'm going to check out this REACT MEETUP on Thursday hosted by @yext and @apav_dev with @hdjirdeh @BHolmesDev. I think there are still spots if anyone wants to join me! meetup.com/real-world-react-…

Real World React avatar
⟳ Aaron Pavlick retweeted
Real World React@rwreact·16 Feb 2023

🗽NYC! We have an🚨IRL Meetup Alert!🚨 🗓️Thur, March 16 📍@YextEng, NYC 🎙️@apav_dev on composing modern static sites 🎙️@BHolmesDev on "opt-in" web design 🎙️tbd (cfp open!) FREE ADMISSION! RSVP here 👇 meetup.com/real-world-react-…

Aaron Pavlick avatar
Aaron Pavlick@apav_dev·23 Jan 2023

I've found that if you define your React component props as a TS type at the start of your file, @github copilot will generate some solid scaffolding for your component most of the time