JSDoc: How to set @param for React element as a function param?

Viewed 3547

What should I add in the JSDoc @param block in the example below for my IntelliJ Webstorm IDE to stop throwing the error: Argument Type ComponentClass<undefined> is not assignable to parameter type ??? ... `?

/**
 * Renders the passed component into a div
 * @param { ??? } component // Question: <<<
 */
const myRenderFunc = (component) => (
  <div>{component}</div>
)
1 Answers

Your React component @param type should be {ReactElement}

Related