Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

FunctionComponent.Of with generics doesn't call memoizeWith

Open
#162 1 comment 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fable-compiler/fable-react

All issues in fable-compiler/fable-react

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.