Skip to content

Getting correct types for stores using custom features with "generic" field-names #4538

Discussion options

You must be logged in to vote

I'm not even half a smart as I wish I were. My problem is that the generic param I provide (Prop) is string, not the value I want.

What I should be writing is this:
withExample<'example'>('example')
What I did write was this:
withExample<string>('example')

That means the actual field generated from the value-parameter "example" in name were generated properly. However in my second example the field-type generated from the generic parameter 'example' in Prop naturally were not - how would they, string doesn't tell you anything.

Now what I wonder more is: Is there a way for me to be able to just write:

withExample<'example'>() instead of withExample<'example'>('example') ?

I would prefer ex…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@PhilippMDoerner
Comment options

@rainerhahnekamp
Comment options

@PhilippMDoerner
Comment options

Answer selected by PhilippMDoerner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants