lolking0
lolking0
TTCTheo's Typesafe Cult
Created by lolking0 on 6/27/2024 in #questions
Prevent Server Action from getting called if unrelated Search Param changes
const Page = async ({searchParams}: { searchParams: { type: string; }; }) => { const type = searchParams?.type || "normal"; const responseData = await fetchData(type); return ( <> <section className="container flex flex-col"> <TypeSelect/> <PokeSearch/> </section> <section className="container"> <Suspense key={type} fallback={<Loader/>}> <PokeGrid responseData={responseData}/> </Suspense> </section> </> ); } I want this to be recalled if type has changed but not if search has changed which is also a query param used in PokeGrid
2 replies
TTCTheo's Typesafe Cult
Created by lolking0 on 3/14/2024 in #questions
hrefLang app router
where to add <link rel="alternate" href={https://www.example.com${router.pathname}} hrefLang="x-default" />
1 replies
TTCTheo's Typesafe Cult
Created by lolking0 on 8/2/2023 in #questions
Possible to do in one loop?
"branchMaterials": [
{
"branchId": 1,
"materialBalances": [
{
"balance": 20.0,
"consignmentMaterialId": 59,
"branchId": 1,
"materialName": "test"
},
"branchMaterials": [
{
"branchId": 1,
"materialBalances": [
{
"balance": 20.0,
"consignmentMaterialId": 59,
"branchId": 1,
"materialName": "test"
},
api returns this, shouldve been grouped by materialName can we do that in one loop?
14 replies