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

[BUG] useBasicStyles type error on Vite #281

Closed
2 of 6 tasks
haw0k opened this issue Sep 12, 2023 · 1 comment
Closed
2 of 6 tasks

[BUG] useBasicStyles type error on Vite #281

haw0k opened this issue Sep 12, 2023 · 1 comment
Assignees
Labels
Bug Something isn't working

Comments

@haw0k
Copy link

haw0k commented Sep 12, 2023

Description

When using vite + react-ts I get error TS2322 if I set useBasicStyles in props

chakra-react-select Version

4.7.1

Link to Reproduction

No response

TypeScript?

  • Yes I use TypeScript

Steps to reproduce

  1. yarn create vite vite-test --template react-ts
  2. cd vite-test
  3. yarn add @chakra-ui/react @emotion/react @emotion/styled framer-motion chakra-react-select
  4. replace src/App.tsx by
import { ChakraProvider } from '@chakra-ui/react';
import { Select } from 'chakra-react-select';

function App() {
  return (
    <ChakraProvider>
      <Select useBasicStyles />
    </ChakraProvider>
  )
}
export default App
  1. Add to package.json "scripts":
"lint-tsc": "tsc --noEmit && eslint src/**/*.ts{,x}",
  1. Run yarn lint-tsc
  2. Got error:
$ yarn lint-tsc
yarn run v1.22.19
$ tsc --noEmit && eslint src/**/*.ts{,x}
src/App.tsx:7:15 - error TS2322: Type '{ useBasicStyles: true; }' is not assignable to type 'IntrinsicAttributes & Omit<PublicBaseSelectProps<unknown, false, GroupBase<unknown>>, StateManagedPropKeys> & Partial<...> & StateManagerAdditionalProps<...> & RefAttributes<...>'.
  Property 'useBasicStyles' does not exist on type 'IntrinsicAttributes & Omit<PublicBaseSelectProps<unknown, false, GroupBase<unknown>>, StateManagedPropKeys> & Partial<...> & StateManagerAdditionalProps<...> & RefAttributes<...>'.

7       <Select useBasicStyles />
                ~~~~~~~~~~~~~~


Found 1 error in src/App.tsx:7

Operating System

  • macOS
  • Windows
  • Linux
  • iOS/iPadOS
  • Android

Additional Information

No errors for create-react-app

@haw0k haw0k added the Bug Something isn't working label Sep 12, 2023
@csandman
Copy link
Owner

Thanks for the heads up, somehow some local changes got included in my publish of v4.7.1. Everything should be fixed in v4.7.2!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants