Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reactive in v3-alpha.28 not woking with some components in nextui #342

Open
LockSwitchDavis opened this issue Jul 30, 2024 · 0 comments
Open

Comments

@LockSwitchDavis
Copy link

import { reactive } from '@legendapp/state/react';
import { Select, SelectItem } from '@nextui-org/react';

const state$ = observable([
  {
    id: 'pm_1',
    type: 'card',
    brand: 'cardA',
  },
  {
    id: 'pm_2',
    type: 'card',
    brand: 'cardB',
  },
]);

const ReactiveSelect = reactive(Select);

const CustomSelector = () => {
  return (
    <ReactiveSelect label="Reactive Select" $items={() => state$.get()}>
       {(method) => {
        return (
          <SelectItem key={method.id} value={method.id} textValue={method.brand}>
            <div className="flex gap-2 items-center">
              {method.brand}
            </div>
          </SelectItem>
        );
      }} 
   </ReactiveSelect>
  )
}

The method param return nothing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant