Skip to content

open action creator props cannot have a property named type #3589

Answered by timdeschryver
tirelyl asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @tirelyl this is indeed something that needs to work this way. An action is required to have a type, based on this property the reducer(s) and effect(s) know what to do with it.
Because it's the core of NgRx (the Redux pattern), you can't change its name.

To solve the problem, you'll have to rename the type property on your end, or wrap it in an object.
For example

// "bad"
const myAction = createAction('[Source] Event', props<User>())
// good
const myAction = createAction('[Source] Event', props<{ user: User }>())

For more info see https://ngrx.io/guide/eslint-plugin/rules/prefer-inline-action-props

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tirelyl
Comment options

Answer selected by tirelyl
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