S
S
stas_mihailov2019-08-16 13:39:48
React
stas_mihailov, 2019-08-16 13:39:48

How to fix Received `false` for a non-boolean attribute `loading` error?

Good afternoon! The page has 2 components that lead to the main page , but because of this, an error is thrown:<Link to="/">
5d5687f07f09a801988657.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
0
0xD34F, 2019-08-16
@0xD34F

You are written in red and white how to fix it. Can't read? Well, go hammer this text into an online translator.
In general, learn English. A developer who is unable to understand English text is unsuitable for professional use.

A
arbuzaicer, 2020-10-11
@arbuzaicer

In general, the solution is something like this:
You need to rewrite the data type that is included in the styledComponent itself,
for example, you need the isOutlined prop:
Place of use: The component itself
<YourComponent isOutlined={true} />

const StyledComponent = ({ ... }) => {...
return <Wrapper ... isOutlined={isOutlined ? isOutlined.toString() : undefined}
}

And the wrapper itself:
const Wrapper = styled.div<{ isOutlined?: string}>`
   border: ${( props) => props.isOutlined ? '2px solid red' : 'none};
`

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question