martpet
martpet
DDeno
Created by martpet on 1/16/2024 in #help
How to use `f-partial` from Fresh?
Thank you Marvin. If someone is curious, here is how I did it: /routes/items/[id]/_(components)/ItemPartial.tsx:
return (
<Partial name="item">
<h1>{props.item.title}</h1>
</Partial>
)
return (
<Partial name="item">
<h1>{props.item.title}</h1>
</Partial>
)
/routes/items/[id]/partial.tsx:
const item = await fetchItem();
return (
<ItemPartial item={item} />
)
const item = await fetchItem();
return (
<ItemPartial item={item} />
)
/routes/items/[id]/index.tsx:
const item = await fetchItem();
return (
<div f-client-nav>
<a href="/items/1" f-partial="/items/1/partial">Item 1</a>
<a href="/items/2" f-partial="/items/2/partial">Item 2</a>
<ItemPartial item={item} />
</div>
)
const item = await fetchItem();
return (
<div f-client-nav>
<a href="/items/1" f-partial="/items/1/partial">Item 1</a>
<a href="/items/2" f-partial="/items/2/partial">Item 2</a>
<ItemPartial item={item} />
</div>
)
29 replies
DDeno
Created by martpet on 1/16/2024 in #help
How to use `f-partial` from Fresh?
I thought somehow that on page load the initial content would be loaded from the partial file
29 replies
DDeno
Created by martpet on 1/16/2024 in #help
How to use `f-partial` from Fresh?
Ok, I think I got it. my content should be duplicated - once in the parent file, and once in the partial file
29 replies
DDeno
Created by martpet on 1/16/2024 in #help
How to use `f-partial` from Fresh?
I mean, there are two files: /routes/my
<div f-client-nav>
<a href="" f-partial="/partials/my-partial">
<Partial name="foo">
my content
</Partial>
</div>
<div f-client-nav>
<a href="" f-partial="/partials/my-partial">
<Partial name="foo">
my content
</Partial>
</div>
/routes/partials/my-partial:
<Partial name="foo">
my content
</Partial>
<Partial name="foo">
my content
</Partial>
29 replies
DDeno
Created by martpet on 1/16/2024 in #help
How to use `f-partial` from Fresh?
Now the question is what do I put in place of <Partial name="something"> in the code above
29 replies
DDeno
Created by martpet on 1/16/2024 in #help
How to use `f-partial` from Fresh?
Then I decided to add f-partial to the link and to move the <Partial name="somthing"> to it's own file , where app wrapper and layout is not used
29 replies
DDeno
Created by martpet on 1/16/2024 in #help
How to use `f-partial` from Fresh?
So I have: <div f-client-nav> <a href="somewhere">link</a> <Partial name="something"> </Partial> </div>
29 replies
DDeno
Created by martpet on 1/16/2024 in #help
How to use `f-partial` from Fresh?
Hi Marvin. Yes, I've been looking at the docs and the blog post, but I'm missing something.
29 replies
DDeno
Created by martpet on 1/16/2024 in #help
How to use `f-partial` from Fresh?
Hey, bot
29 replies
DDeno
Created by martpet on 7/13/2023 in #help
Prefix Kv keys with a base part
Hmm, yes. But this won't work in Deploy i guess
6 replies
DDeno
Created by playerx on 5/27/2023 in #help
Deno Deploy with Cloudflare Proxy
Do you recommend using CloudFlare with Deno Deploy?
6 replies
DDeno
Created by playerx on 5/27/2023 in #help
Deno Deploy with Cloudflare Proxy
Did you find an answer? I don't get the IP address or any location headers from CloudFlare 🤔
6 replies
DDeno
Created by martpet on 6/29/2023 in #help
Deno KV: subtract with `sum` operation?
Thank you so much. I don't know what 0xffffffffffffffffn is but it works 🙂
4 replies
DDeno
Created by martpet on 6/17/2023 in #help
Fresh: global state
Actually I can just use ‘export const state = { value: “” }’
7 replies
DDeno
Created by martpet on 6/17/2023 in #help
Fresh: global state
Yes, but arent' signals only for islands? I haven't used islands yet
7 replies