tabs icon indicating copy to clipboard operation
tabs copied to clipboard

React does not recognize the `isActive` prop on a DOM element.

Open TrejoCode opened this issue 4 years ago • 6 comments

Hello, I found the following error implemented the Tabs, my code is as follows:

React Version:

"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1",

Warning: React does not recognize the `isActive` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `isactive` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
import React, { useState, useEffect } from "react";
import { Tabs, Tab, Panel } from '@bumaga/tabs';

const PageExample = () => {

    // Active Tab
    const [index, setIndex] = useState(0);
    
    /**
     * @description Establecer la Tab inicial
    */
    useEffect(() => {
        setIndex(1)
    }, []);

    return(
        <div className="tab-container">
            <Tabs state = {[ index, setIndex ]}>
                <div>
                    <Tab>
                        <div className="align-center">
                            <span className="tab-head cursor-pointer">
                                Tab 1
                            </span>
                        </div>
                    </Tab>
                    <Tab>
                        <div className="align-center">
                            <span className="tab-head cursor-pointer">
                                Tab 2
                            </span>
                        </div>
                    </Tab>
                </div>
                <Panel>
                    <div className="__container">
                        <div className="products wrap">
                            Content 1
                        </div>
                    </div>
                </Panel>
                <Panel>
                    <div className="__container column">
                        Content 2
                    </div>
                </Panel>
            </Tabs>
        </div>
    );
export default PageExample;

Can you help me?

TrejoCode avatar May 07 '20 18:05 TrejoCode

Have the same issue ;(

IvanTsiupa avatar May 17 '20 12:05 IvanTsiupa

Same issue

marcpozzi avatar Jun 04 '20 21:06 marcpozzi

Same issue..

RectoVersoDev avatar Jun 05 '20 07:06 RectoVersoDev

Experiencing same issue too

dhatGuy avatar Jul 27 '20 18:07 dhatGuy

Change isActive to $isActive

TaekyungAn avatar Jul 08 '23 05:07 TaekyungAn

It works if you add $ as decorator. Ex: const Container = styled.div' color: ${({ $isactive }) => ($isactive ? "white" : "gray")}; '; And from container: <Container $isactive={!!user}>

Source

jespadas avatar Mar 29 '24 13:03 jespadas