Skip to content

Commit

Permalink
fix: vue component typing in react
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemSBulgakov committed Sep 30, 2024
1 parent b54d617 commit 4abfb7f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/components/room-booking/BookModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,14 @@ export function BookModal({

const { getFloatingProps } = useInteractions([dismiss, role]);

const titleInputRef = useRef(null);
const titleInputRef = useRef<HTMLInputElement>(null);

const [title, setTitle] = useState("");

const submitBooking = useCallback(() => {
if (!data) return;
if (!title) {
titleInputRef.current.focus();
titleInputRef.current?.focus();
return;
}

Expand Down
3 changes: 2 additions & 1 deletion src/components/room-booking/BookingTimeline.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { FunctionComponent } from "react";
import { applyVueInReact } from "veaury";
import RoomBookingViewVue from "./BookingTimeline.vue";

const BookingTimeline = applyVueInReact(RoomBookingViewVue);
export default BookingTimeline;
export default BookingTimeline as FunctionComponent<any>;
2 changes: 1 addition & 1 deletion src/components/room-booking/RoomBookingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function RoomBookingPage() {
<>
<BookingTimeline
className="flex max-h-full"
onBooking={(data) => {
onBooking={(data: BookingData) => {
setBookingModalData(data);
setModalOpen(true);
}}
Expand Down
1 change: 1 addition & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="vite/client" />
/// <reference types="vite-plugin-pwa/vanillajs" />
/// <reference types="vite-plugin-pwa/react" />
declare module "*.vue";
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import mdx from "@mdx-js/rollup";
import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
import remarkGfm from "remark-gfm";
// @ts-expect-error The plugin is not typed
import veauryVitePlugins from "veaury/vite/index.js";
import { defineConfig } from "vite";
import { ViteMinifyPlugin } from "vite-plugin-minify";
Expand Down

0 comments on commit 4abfb7f

Please sign in to comment.