Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

f-partial does nothing #2544

Closed
finalclass opened this issue Jun 24, 2024 · 2 comments
Closed

f-partial does nothing #2544

finalclass opened this issue Jun 24, 2024 · 2 comments
Labels

Comments

@finalclass
Copy link

I've created a brand new project (the way described in the docs).
Then I've added two files:

routes/test/index.tsx

import { Partial } from "$fresh/runtime.ts";

export default function Test() {
  return (
    <div>
      TEEEEEEEEEEE
      <a href="" f-partial="/partials/test">GO</a>

      <Partial name="CartProducts">
        ???
      </Partial>
    </div>
  );
}

routes/partials/test.tsx

import { Partial } from "$fresh/runtime.ts";

export default function Test() {
  return (
    <Partial name="CartProducts">
      DONE
    </Partial>
  );
}

After visiting the /test route and clicking the "GO" button the page refreshes instead of loading the partial.

@marvinhagemeister
Copy link
Collaborator

Partials only become active if the element you clicked on or one of its ancestors has f-client-nav attribute set. If that is not set or it's set to false, then partials are disabled. See https://fresh.deno.dev/docs/concepts/partials

Wondering if we should enable this by default when f-partial is set. That might be less confusing.

@finalclass
Copy link
Author

finalclass commented Jun 25, 2024

Thanks for clarifying. Maybe adding a full code example here would be clearer:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants