react does not recognize the 'fullWidth' prop on a DOM element
Asked Answered
P

2

10
  • error Screenshot

enter image description here

enter image description here

enter image description here

  • I used fullWidth as a property. when I remove those, I see also the error.

  • I used isLoading as a variable, not a prop.

  • I didn't use colorKey in our code. but found this error for colorKey.

  • Where am I using fullWidth isLoading is given below

enter image description here

enter image description here

enter image description here

enter image description here - There is no colorKey.

I need to know which topic I can check to solve this error. any clue? any suggestion to get rid of this error?

Source code: https://github.com/CrazyPythonLover1/africaswap-interface-master/tree/main/src

Technology: React, styled-components, TypeScript.

Pedropedrotti answered 22/2, 2021 at 13:2 Comment(6)
You're somehow passing those props down to DOM elements.Varion
How to find, where I am passing those props. I am searching in VS code for whole with ctrl+shift+fPedropedrotti
I think it's the library you're using, pancakeswapVarion
yes, it is a libraryPedropedrotti
How to solve this kind of problem? any Idea. I am have been searching for 3 daysPedropedrotti
One option is to create an issue directly for the maintainers of the package: github.com/pancakeswap/pancake-uikit/issuesSlick
I
2

Without needing to specifically look into your Pancake UI library (The same problem you're facing happens with Material-UI for example);
The library is passing properties to its children which are part of the library for some reason on to children DOM nodes without getting filtered out. You can circumvent this by creating a simple additional component that only renders the necessary props to its children.

This is a generic example, in case you want to render a div only only want the style to stay:

const RemoveDomProps=({style,children})=>(<div style={style}>{children}</div>)

Then you'd use it as a wrapper inside your code:

<MyUILibraryComponent>
    <RemoveDomProps style={{...}}>
        {...}
    </RemoveDomProps>
</MyUILibraryComponent>
Ixion answered 30/5, 2023 at 10:9 Comment(0)
R
-3

Just find where you are using fullWidth by pressing Ctrl+f and search fullWdth and replace it with fullwidth

Reprobation answered 18/5, 2022 at 9:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.