Looking at adopting using redux-toolkit in our app but I can't seem to get the doc comments we have for our action creators to show.
Old code:
const ADD_NAME = 'ADD_NAME';
/**
* Sets the name for the user in our state.
* @param name The updated name
*/
export function addName(name: string) {
return {
payload: name,
type: ADD_NAME,
};
}
In VSCode, whenever I dispatch addName(), hovering over the function gives me the tooltip with the documentation there as expected.
Recreating this action creator using redux-toolkit:
/**
* Sets the name for the user in our state.
* @param name The updated name of the User
*/
export const addName = createAction<string>(ADD_NAME);
When I hover over this new addName during a dispatch, instead of seeing the documentation I wrote:
Sets the name for the user in our state.
I see this:
Calling this {@link redux#ActionCreator} with an argument will return a {@link PayloadAction} of type T with a payload of P
That's the internal documentation for ActionCreatorWithPayload from the redux-toolkit typings file.
What am I missing that the doc comments I added for my addName action creator is shown and not the redux-toolkit doc comments?
I realize one is me commenting a function and the other is commenting a const var, but I'd have expected my comments for that addName const to be shown as the tooltip, no?
