Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

140
Visualizações
trublle with component in React

I had a problem exporting NavBottom and I don't understand why the problem is that when I insert it into a component it knocks out an error, but the import and export are correct. Maybe there are nuances when using TypeScript, I recently started using it. I will be glad for any answer to my problem. Maybe I must "open" do object ?


TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & boolean'.
  Type '{}' is not assignable to type 'true'.
    46 |         <div />
    47 |       </StyledBurger>
  > 48 |       <NavBottom  />
       |        ^^^^^^^^^
    49 |     </>
    50 |   )
    51 | }
import React, { useState } from 'react';
const styled = require('styled-components');
import {NavBottom} from './NavBottom';  

const BurgerMenu = () => {

  const [open, setOpen] = useState(false)

  const StyledBurger = styled.div`
  width: 2rem;
  height: 16px;
  margin-top:16px;
  margin-left: 19px;
  position: fixed;
  z-index: 20;
  display: none;
    display: flex;
    justify-content: space-around;
    flex-flow: column nowrap;
  div {
    width: 18px;
    height: 2px;
    background-color: #fff;
    border-radius: 10px;
    transform-origin: 1px;
    transition: all 0.3s linear;
    &:nth-child(1) {
      transform: ${open ? 'rotate(45deg)' : 'rotate(0)'};
    }
    &:nth-child(2) {
      transform: ${open ? 'translateX(100%)' : 'translateX(0)'};
      opacity: ${open ? 0 : 1};
    }
    &:nth-child(3) {
      transform: ${open ? 'rotate(-45deg)' : 'rotate(0)'};
    }
  }
`;

interface Props {
  open: boolean;
}
  
  return (
    <>
      <StyledBurger open={open} onClick={() => setOpen(!open)}>
        <div />
        <div />
        <div />
      </StyledBurger>
      <NavBottom open={open} />
    </>
  )
}

export {BurgerMenu};
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

just try to define your function like export const NavBottom = () =>, then import it without using {} - import NavBottom from.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda