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

[📖] onLoad$ img cookbook #6246

Open
PatrickJS opened this issue May 6, 2024 · 0 comments
Open

[📖] onLoad$ img cookbook #6246

PatrickJS opened this issue May 6, 2024 · 0 comments
Labels
COMMUNITY: good first issue Good for newcomers COMMUNITY: PR is welcomed We think it's a good feature to have but would love for the community to help with the PR for it COMP: docs Improvements or additions to documentation

Comments

@PatrickJS
Copy link
Member

PatrickJS commented May 6, 2024

Suggestion

document a better way to detect onLoad for images
#4481

Suggestion:

const imgRef = useSignal<HTMLImageElement>();
useVisibleTask$(()=> { 
  imgRef.value!.decode().then(() => { 
    console.log('loaded and ready!');
  });
});
    
// other logic etc
return (
  <section>
    <img ref=[imgRef} srf="some-source.png" height={200} width={200} />
  </section>
);
@PatrickJS PatrickJS added COMP: docs Improvements or additions to documentation STATUS-1: needs triage New issue which needs to be triaged labels May 6, 2024
@gioboa gioboa added the STATUS-2: docs team is working on this This goes into the backlog of the docs team label Jun 19, 2024
@maiieul maiieul added STATUS-2: requires discussion Requires further discussion before moving forward and removed STATUS-1: needs triage New issue which needs to be triaged STATUS-2: docs team is working on this This goes into the backlog of the docs team labels Jul 16, 2024
@maiieul maiieul removed the status in Documentation Tasks Jul 16, 2024
@maiieul maiieul added COMMUNITY: good first issue Good for newcomers COMMUNITY: PR is welcomed We think it's a good feature to have but would love for the community to help with the PR for it and removed STATUS-2: requires discussion Requires further discussion before moving forward labels Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMMUNITY: good first issue Good for newcomers COMMUNITY: PR is welcomed We think it's a good feature to have but would love for the community to help with the PR for it COMP: docs Improvements or additions to documentation
Projects
Status: Backlog
Development

No branches or pull requests

3 participants