(часть интерфейса)
                  
                  
                  interface SwitchItemsLayout {
                  
                  
                    section: string;
                  
                  
                    switchText: string;
                  
                  
                    switchComponent: React.ReactNode;
                  
                  
                  }
                  
                  
                  interface SideBarProps {
                  
                  
                      ***
                  
                  
                      switchItems: { [key: string]: SwitchItemsLayout };
                  
                  
                      ***
                  
                  
                  вот где собсна выдыет
                  
                  
                  
                  
                  
                  const switchItems = {
                  
                  
                    'login': {
                  
                  
                      section: 'login',
                  
                  
                      switchText: 'Log In',
                  
                  
                      switchComponent: <p>💩🔥💩</p>
                  
                  
                    },
                  
                  
                    'register': {
                  
                  
                      section: 'register',
                  
                  
                      switchText: 'Sign Up',
                  
                  
                      switchComponent: <RegistrationWizard />
                  
                  
                    },
                  
                  
                  };
                  
                  
                  получаю на выходе
                  
                  
                  error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & void & { children?: ReactNode; }'.
                  
                  
                    Type '{}' is not assignable to type 'void'.
                  
                  
                  
                  
                  
                  ЧЯДНТ?
                  
                  
                
@typescript_ru
Обсуждают сегодня