Open jonit-dev opened 1 year ago
@jonit-dev Did you mean "jsx": "react-jsx"
?
Yeah, sorry
Facing the same issue
@jonit-dev @ayush-seth I ended up moving my project to use turborepo with tsup. You can check the examples here: https://github.com/vercel/turborepo/tree/main/examples Turborepo is developed by @jaredpalmer the creator of tsdx.
Thanks @avitorio but turborepo doesn't cover my use case here. I was just looking for a simple way to publish my tailwind component library for React with ts support so I can use it in my other projects
Hey @ayush-seth, Although not a component library, my package also uses tailwind. This example can propably be used for your use case: https://github.com/vercel/turborepo/tree/main/examples/with-tailwind
Facing the same issue
I solved it by importing React manually in all story files.
Unfortunately... 😞
You can set the ts version of tsdx to 4.4 or afterwards. hopefully new version will upgrade the ts. for now manually works.
if you are using yarn than you can
"resolutions": {
"tsdx/typescript": "^4.7.4",
}
or npm
"overrides": {
"tsdx/typescript": "^4.7.4",
}
My typescript version is 5.2.2 but still gettin error my project created with vite and tsconfig file is true i don't want import React because it is unnecessary this is my code at UserContext.Provider i get this error
import { createContext, useState } from "react";
const UserContext = createContext({});
export function UserProvider({ children }) {
const [user, setUser] = useState({ name: "", email: "" });
return (
<UserContext.Provider value={{ user, setUser }}>
{children}
</UserContext.Provider>
);
}
overrides
I face the same issue with vite, do we know if there is a solution?
Current Behavior
I suddenly started to receive the error below in some of my components.
Expected behavior
No errors are displayed.
Suggested solution(s)
A temporary workaround is adding "import React from 'react'" on the top of the file. Changing the VSCode typescript version does not work. Adding jsx: "react-dev" to tsconfig.json breaks tsdx build process.
Your environment