pacocoursey / cmdk

Fast, unstyled command menu React component.
https://cmdk.paco.me
MIT License
9.03k stars 258 forks source link

How to use asChild in Command.input ? #241

Open zecka opened 3 months ago

zecka commented 3 months ago

I'm not sure to understand how to us asChild props on Command.Input

I try it like that

    <Command>
      <Command.Input asChild>
        <input type="text" />
      </Command.Input>
      <Command.List>
         <Command.Item>Apple</Command.Item>
         <Command.Item>Orange</Command.Item>
        <Command.Item>Fish</Command.Item>
      </Command.List>
    </Command>

But got following error

input is a void element tag and must neither have children nor use dangerouslySetInnerHTML.

related to this PR: https://github.com/pacocoursey/cmdk/pull/138