Skip to content

Cannot read props in async resource fetcher #195

@elsassph

Description

@elsassph

Describe the bug

Can't read props in an async resource fetcher function. I'd think it is expected that the function should be considered untracked.

To Reproduce

const [res] = createResource(input, async (input) => { // <-- solid/reactivity for the function
   const thing = props.thing;
   const result = await fetchSomething(input, thing);
   return result;
});

Expected behavior

I shouldn't be forced to disable the rule for the function.

Screenshots

Environment (please complete the following information):

  • OS: [e.g. Mac OS 11, Windows 10]
  • Node version (node --version):
  • eslint-plugin-solid version (npm list eslint-plugin-solid/yarn why eslint-plugin-solid): 0.14.5
  • eslint version (npm list eslint/yarn why eslint): 8.57.1

Additional context

  • I would be willing to contribute a PR to fix this issue

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions