Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

143
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!