Also unpack React / don't directly import React (#8384)

This commit is contained in:
Alex van Andel
2023-04-19 20:24:34 +02:00
committed by GitHub
parent 9e17149e5e
commit d91b451d7b
+4 -3
View File
@@ -1,5 +1,6 @@
import Head from "next/head";
import React, { createContext, useContext, useState, useEffect } from "react";
import { createContext, useContext, useState, useEffect } from "react";
import type { ReactNode } from "react";
import { APP_NAME } from "@calcom/lib/constants";
@@ -7,7 +8,7 @@ type MetaType = {
title: string;
description: string;
backButton?: boolean;
CTA?: React.ReactNode;
CTA?: ReactNode;
};
const initialMeta: MetaType = {
@@ -27,7 +28,7 @@ export function useMeta() {
return useContext(MetaContext);
}
export function MetaProvider({ children }: { children: React.ReactNode }) {
export function MetaProvider({ children }: { children: ReactNode }) {
const [value, setValue] = useState(initialMeta);
const setMeta = (newMeta: Partial<MetaType>) => {
setValue((v) => ({ ...v, ...newMeta }));