اذهب إلى المحتوى

عبد الحميد بومقواس

الأعضاء
  • المساهمات

    7
  • تاريخ الانضمام

  • تاريخ آخر زيارة

أجوبة بواسطة عبد الحميد بومقواس

  1. أنا أعمل على مشروع بواسطة NextJS باستخدام TypeScript

    لدي مشكلة في هذا السطر :

      const Layout = layouts[Component.layout] || ((children) => <>{children}</>)

    هذا هو الخطأ الذي ظهر لي 

    var Component: NextComponentType<NextPageContext, any, {}>
      
    Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{ L1: FC<{}>; L2: FC<{}>; }'.ts(7053)

    وهذا هو الكود الكامل

    // App Style
    import '../src/css/app.css'
    import { AnimatePresence } from 'framer-motion'
    import React from "react";
    
    import type { AppProps } from 'next/app'
    import AuthLayout from "../layouts/AuthLayout";
    import ContentLayout from "../layouts/ContentLayout";
    
    function MyApp({ Component, pageProps }: AppProps) {
      const layouts = {
        L1: AuthLayout,
        L2: ContentLayout,
      };
      const Layout = layouts[Component.layout] || ((children) => <>{children}</>)
      return (
        <Layout>
          <AnimatePresence exitBeforeEnter>
            <Component {...pageProps} />
          </AnimatePresence>
        </Layout>
      );
    }
    export default MyApp

     

    Screenshot from 2021-08-23 14-51-46.png

    • أعجبني 1
  2. السلام عليكم 

    نعم... Vue هي مكتبة سهلة الاستخدام مقارنة بال React JS وسريعة أيضا .. أما بالنسبة للـ SEO حالها كحال React JS فهناك مكتبات تثبتها في مشروعك الخاص ولكنها بالنسبة لي تبدو معقدة بعض الشيء 

    أنصح باستخدام Nuxt js للـ Vue JS أو Next JS للـ React JS واستخدام server-side rendering (SSR) فهما صديقين للـ SEO ومحركات البحث 

×
×
  • أضف...