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

UseFetcher causes links to be loaded again #5448

Closed
1 task done
s446683009 opened this issue Feb 14, 2023 · 5 comments · Fixed by #6679
Closed
1 task done

UseFetcher causes links to be loaded again #5448

s446683009 opened this issue Feb 14, 2023 · 5 comments · Fixed by #6679
Labels
bug Something isn't working feat:links-meta Issues related to links()/meta() feat:routing

Comments

@s446683009
Copy link

s446683009 commented Feb 14, 2023

What version of Remix are you using?

1.2.0

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

add link.

/*root.tsx*/
import {cssBundleHref} from '@remix-run/css-bundle';
import iconfontCss from './styles/iconfont/iconfont.css'
import globalCss from './styles/global.css'

export const links = () => {
  return [
    {
      rel: "stylesheet",
      href: iconfontCss,
    },
    {
      rel: "stylesheet",
      href: globalCss,
    },
    ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
  
  ];
};

create user login api route.

/*routes/apis_.user.login.tsx*/
import { ActionArgs } from "@remix-run/server-runtime";
export async function action({}:ActionArgs){
    return await new Promise((resolve,reject)=>{
        setTimeout(() => {
            resolve("login success");
        }, 3000);
    })
}

use useFetcher .

/*routes/login.tsx*/
function Login() {
var fet=useFetcher();
useEffect(()=>{
     fet.submit({},{
      method:'post',
      action:'/apis/user/login',
   
  })},[]);


/*....*/
 }

Expected Behavior

just load one time css link. like this:
image

Actual Behavior

after fetch.submit api route. the css link in root.tsx load again.
image

by the way, I used css module.

@github-actions
Copy link
Contributor

This issue has been automatically marked stale because we haven't received a response from the original author in a while 🙈. This automation helps keep the issue tracker clean from issues that are not actionable. Please reach out if you have more information for us or you think this issue shouldn't be closed! 🙂 If you don't do so within 7 days, this issue will be automatically closed.

@github-actions github-actions bot added needs-response We need a response from the original author about this issue/PR and removed needs-response We need a response from the original author about this issue/PR labels Apr 17, 2023
@brophdawg11 brophdawg11 added bug Something isn't working feat:routing feat:links-meta Issues related to links()/meta() and removed bug:unverified labels May 4, 2023
@remix-run remix-run deleted a comment from vaynevayne Jun 23, 2023
@brophdawg11
Copy link
Contributor

This is fixed by #6679 and should be available in the next release.

@brophdawg11 brophdawg11 added the awaiting release This issue has been fixed and will be released soon label Jul 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2023

🤖 Hello there,

We just published version v0.0.0-nightly-eccc180-20230707 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 1.19.0-pre.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 1.19.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@brophdawg11 brophdawg11 removed the awaiting release This issue has been fixed and will be released soon label Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feat:links-meta Issues related to links()/meta() feat:routing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants