gluestack / gluestack-ui

React & React Native Components & Patterns (copy-paste components & patterns crafted with Tailwind CSS (NativeWind))
https://gluestack.io/
MIT License
2.75k stars 120 forks source link

This JSX tag's 'children' prop expects type 'string & {}' which requires multiple children, but only a single child was provided.ts(2745) #1592

Open Gluant101 opened 10 months ago

Gluant101 commented 10 months ago

Description

https://discord.com/channels/1050761204852858900/1054373041435574322/1193259014201540758

CodeSandbox/Snack link

No response

Steps to reproduce

  1. Go to '...'
  2. Click on '...'
  3. Scroll down to '...'
  4. See error

gluestack-ui Version

3.3.1

Platform

Other Platform

No response

Additional Information

Using this component:

toast.show({
            placement: 'bottom left',
            render: ({ id }) => {
              const toastId = 'toast-' + id;
              return (
                <Toast nativeID={toastId}>
                  <ToastDescription>
                    {translate('messageError.errorToGetConversation')}
                  </ToastDescription>
                </Toast>
              );
            }
          });

Using This: https://gluestack.io/ui/docs/components/feedback/toast

DennisHesler commented 10 months ago

The problem I encountered stemmed from using the command 'npx gluestack-ui-scripts eject-theme' to customize the theme without setting all the configurations. This oversight led to TypeScript errors. I resolved the issue by completing the necessary settings in the createConfig from '@gluestack-style/react'. Now my question is how do I use the configuration files created in config/theme?

Nashmod commented 9 months ago

I'm having the same issue, I don't think I had any errors before ejecting but now when I use any component all the props are giving a type not assignable error.

image