FunctionComponent.Of with generics doesn't call memoizeWith
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 32/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- fsharp, react
- Domain
- frontend
Research direction
Reproduce the generic and non-generic FunctionComponent.Of examples, comparing whether memoizeWith runs and whether the generic component rerenders infinitely. Then inspect the Fable/React implementation of FunctionComponent.Of and its memoizeWith handling; done means generic components invoke the callback and no longer rerender indefinitely.
Written by the indexing model from the issue text.
Description
Given I have the following code
let test<'T> =
FunctionComponent.Of((fun (props: {|Dispatch: Msg -> unit; test: 'T|}) ->
log props.test
span [] []
]), memoizeWith= fun o n -> log "haha"; false)
// Use somewhere in the code say at the root component
test({|Dispatch=dispatch; test: 5|})
The memoizeWith callback is not called, and for some reason the function keeps getting called infinitely.
If I change it to a non generic then it works fine
let test =
FunctionComponent.Of((fun (props: {|Dispatch: Msg -> unit; test: int|}) ->
log props.test
span [] []
]), memoizeWith= fun o n -> log "haha"; false)
// Use somewhere in the code say at the root component
test({|Dispatch=dispatch; test: 5|})
Not sure if this is an issue with Fable or React.
- Dominant language
- F#
- Stars
- 277
- Forks
- 65
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fable-compiler/fable-react
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
fable-compiler/fable-react#243 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
fable-compiler/fable-react#241 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
fable-compiler/fable-react#240 · 5 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
fable-compiler/fable-react#239 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
fable-compiler/fable-react#236 ·
All issues in fable-compiler/fable-react
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
pastelsky/bundlephobia#1122 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
speaches-ai/speaches#678 ·
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
jellyfin/jellyfin-web#8540 ·