Exclude a specific path/url form autoFetch

Hello Everyone,
I’m new to this framework and right now working on my first project. I would like to know if there is any way to exclude a specific path (example “/helloworld”) from autoFacting.
What i’m trying to do is show some react component in “/helloworld” page, but as I don’t have this url in my wp i’m getting a 404 error in shell console. I looked for the documentation but only found a tiny-router setting “autoFetch”, if I make that false the full autoFatch is turned off.
A help is highly appreciated.
Best regards

Hi @rezaurc

Welcome to the Frontity community. TBH I’m not sure what you’re trying to do. Do you have a link to a repo that you can share with us so we can take a look at your code? Thanks.

Thanks for your response, Sorry I was not able to make my self clear.
All I wanted to do is to, use(show/display react component) a endpoint(/helloworld), that is not available on wp.
Regarding the repo it’s just fresh install(npx frontity create …) as is without any change jsut go to /helloword, you will see 404(as expected).
All I want is use /helloword
Hope it make sense

Hi @rezaurc

OK, I think I understand. Let’s see if this what you need.

I’m going to assume that you’re using mars-theme. Import your component into the theme’s index.html file.

import MyComponent from "./mycomponent"

then add <MyComponent when={state.router.link === '/helloworld/'} /> to the main <Switch> statement.

<Main>
      <Switch>
          <Loading when={data.isFetching} />
          <MyComponent when={state.router.link === '/helloworld/'} />
          <List when={data.isArchive} />
          <Post when={data.isPostType} />
          <PageError when={data.isError} />
      </Switch>
</Main>

Hope this helps. Let me know if this works for you.

Yes, That work as expected, but the issue is, it’s a 404 response, as I get the error in terminal on on browser network also it’s a 404, how can I make it 200 OK
Thanks again for your time

Hi @rezaurc

I’m really sorry, but once again I don’t think I understand you. Did your custom component appear in the browser when the URL was ‘/helloworld/’, or did you get the 404 component displayed?