相关文章推荐
不羁的围巾  ·  python 学习笔记二十 ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I'm using JSDoc 3.6.4 with my React project. I've defined the following hook ...

import { useState } from "react";
 * The form hook.  Sets handlers and initial properties of a form. 
 * @param {Object.<string, string>} initialValue
 * @returns {object}
const useForm = (initialValue = {}) => {
  const [values, setValues] = useState(initialValue);
  const reset = () => {
    setValues(initialValue);
  const handleChange = ({ target }) => {
    setValues((values) => ({
      ...values,
      [target.name]: target.value,
  return {
    handleChange,
    values,
    reset,
    setValues,
export default useForm;

What's the proper way to document what is returned when there are multiple things returned? I would like to put more than {object}, which is what I have now.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.