Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update getting-started.mdx #452

Merged
merged 1 commit into from May 8, 2022
Merged

Conversation

anoushk1234
Copy link
Contributor

fixes #441

@jrgarciadev
Copy link
Member

Hey @anoushk1234 thank you so much, could you please write it this way:

import React from 'react';

// ...
   return {
      ...initialProps,
      styles: (
        <React.Fragment>
          {initialProps.styles}
        </React.Fragment>
      )
    };

// ...

@antoinelin
Copy link

Hey @anoushk1234 thank you so much, could you please write it this way:

import React from 'react';

// ...
   return {
      ...initialProps,
      styles: (
        <React.Fragment>
          {initialProps.styles}
        </React.Fragment>
      )
    };

// ...

Hey, got a TypeScript issue using styles: (<Fragment>{initialProps.styles}</Fragment>) instead of styles: [<Fragment>{initialProps.styles}</Fragment>] + Fragment should have a key for proper React rendering

@jrgarciadev
Copy link
Member

jrgarciadev commented May 5, 2022

Hey @anoushk1234 thank you so much, could you please write it this way:

import React from 'react';

// ...
   return {
      ...initialProps,
      styles: (
        <React.Fragment>
          {initialProps.styles}
        </React.Fragment>
      )
    };

// ...

Hey, got a TypeScript issue using styles: (<Fragment>{initialProps.styles}</Fragment>) instead of styles: [<Fragment>{initialProps.styles}</Fragment>] + Fragment should have a key for proper React rendering

Hey @toinelin could you share your tsconfig.json?

@antoinelin
Copy link

Hey @anoushk1234 thank you so much, could you please write it this way:

import React from 'react';

// ...
   return {
      ...initialProps,
      styles: (
        <React.Fragment>
          {initialProps.styles}
        </React.Fragment>
      )
    };

// ...

Hey, got a TypeScript issue using styles: (<Fragment>{initialProps.styles}</Fragment>) instead of styles: [<Fragment>{initialProps.styles}</Fragment>] + Fragment should have a key for proper React rendering

Hey @toinelin could you share your tsconfig.json?

Sure here it is:

{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "baseUrl": ".",
    "paths": {
      "@/components/*": [
        "./components/*"
      ],
      "@/contexts/*": [
        "./contexts/*"
      ],
      "@/hooks/*": [
        "./hooks/*"
      ],
      "@/pages/*": [
        "./pages/*"
      ],
      "@/styles/*": [
        "./styles/*"
      ]
    },
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
  "exclude": ["node_modules"]
}

@anoushk1234
Copy link
Contributor Author

<React.Fragment>
          {initialProps.styles}
        </React.Fragment>

i'm getting this error Type 'Element' is not assignable to type 'ReactElement<any, string | JSXElementConstructor<any>>[] | ReactFragment | undefined'.

heres my tsconfig https://github.com/anoushk1234/anoushk.xyz/blob/main/tsconfig.json

Copy link
Member

@jrgarciadev jrgarciadev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 🙌🏻 @anoushk1234

@jrgarciadev jrgarciadev merged commit b5061a4 into nextui-org:main May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error in Documentation for _document.tsx
3 participants