Uncaught TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))

I want to see that some data will come from an array through the checkbox. But when I select such an error is showing!

Screenshort

{groupList && groupList.length > 0 && (
    <div className="form-check form-check-inline">
        {groupList.map((group) => (
          <div>
            <input
              className="form-check-input"
              type="checkbox"
              id={group.id}
             
              value={group.id}
              onChange={(e) => {
                setGroups(
                  Array.from(
                    e.target.options,
                    (item) => item.value
                  )
                );
                
              }}
            />
            <label className="form-check-label" htmlFor={group.id}>
              {group.name}
            </label>
          </div>
        ))}  
  </div>
)}

How to solve?

Thanks in advance.

Back to Top