jeetiss / tabs

React tabs with hooks
https://jeetiss.github.io/tabs/
208 stars 30 forks source link

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

Open TrejoCode opened 4 years ago

TrejoCode commented 4 years ago

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?

IvanTsiupa commented 4 years ago

Have the same issue ;(

marcpozzi commented 4 years ago

Same issue

RectoVersoDev commented 4 years ago

Same issue..

dhatGuy commented 4 years ago

Experiencing same issue too

TaekyungAn commented 1 year ago

Change isActive to $isActive

jespadas commented 7 months ago

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

Source