Skip to content

Commit

Permalink
fix react-components docs
Browse files Browse the repository at this point in the history
  • Loading branch information
uvarov-frontend committed Dec 1, 2023
1 parent d6b1c25 commit 076c94f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions docs/en/learn/additional-features/react-component.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@ To create a React component named VanillaCalendar.tsx, you need to copy the code
import { HTMLAttributes, useEffect, useRef, useState } from "react";
import VC, { Options } from "vanilla-calendar-pro";
import "vanilla-calendar-pro/build/vanilla-calendar.min.css";
import "vanilla-calendar-pro/build/themes/dark.min.css";
import "vanilla-calendar-pro/build/themes/light.min.css";

interface VanillaCalendarProps extends HTMLAttributes<HTMLDivElement> {
config?: Options,
}

function VanillaCalendar({ config, ...attributes }: VanillaCalendarProps) {
const ref = useRef<HTMLDivElement>(null);
const [calendar, setCalendar] = useState<VC<HTMLDivElement, Options> | null>(null);
const [calendar, setCalendar] = useState<VC | null>(null);

useEffect(() => {
if (!ref.current) return
Expand Down
4 changes: 1 addition & 3 deletions docs/ru/learn/additional-features/react-component.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@
import { HTMLAttributes, useEffect, useRef, useState } from "react";
import VC, { Options } from "vanilla-calendar-pro";
import "vanilla-calendar-pro/build/vanilla-calendar.min.css";
import "vanilla-calendar-pro/build/themes/dark.min.css";
import "vanilla-calendar-pro/build/themes/light.min.css";

interface VanillaCalendarProps extends HTMLAttributes<HTMLDivElement> {
config?: Options,
}

function VanillaCalendar({ config, ...attributes }: VanillaCalendarProps) {
const ref = useRef<HTMLDivElement>(null);
const [calendar, setCalendar] = useState<VC<HTMLDivElement, Options> | null>(null);
const [calendar, setCalendar] = useState<VC | null>(null);

useEffect(() => {
if (!ref.current) return
Expand Down

0 comments on commit 076c94f

Please sign in to comment.