Open AbbasRam opened 8 months ago
Workaround for this:
setChonkyDefaults({ iconComponent: ChonkyIconFA as any });
The workaround stated in the comment above works for the first issue mentioned
For the second issue, it appears to be related to compatibility with React v18.
Workaround for second issue:
const _FullFileBrowser = FullFileBrowser as any;
export const MyFileBrowser = () => {
const files = [
{ id: "lht", name: "Projects", isDir: true },
{
id: "mcd",
name: "chonky-sphere-v2.png",
thumbnailUrl: "https://chonky.io/chonky-sphere-v2.png",
},
];
const folderChain = [{ id: "xcv", name: "Demo", isDir: true }];
return (
<div style={{ height: 300 }}>
<_FullFileBrowser files={files} folderChain={folderChain} />
</div>
);
};
@OrhanTozan thank you so much. I just had this same error.
For the second issue, I used the following for better intellisense experience in vscode:
import { FullFileBrowser as F, FileBrowserProps, FileBrowserHandle } from 'chonky';
const FullFileBrowser = F as React.MemoExoticComponent<React.ForwardRefExoticComponent<FileBrowserProps & React.RefAttributes<FileBrowserHandle>>>;
setChonkyDefaults({ iconComponent: ChonkyIconFA });
ReactDOM.createRoot(document.getElementById("root")!).render(