Skip to content

Context only shown once when Context is renderered >= 2 times #102

@mqliutie

Description

@mqliutie
const Context = React.createContext();

const arr = Array.from({length:3})

const Test =()=>{

     return <>
         arr.map((_,index)=>{
               return <T1 key={index}>
         })
     </>
}

const T1 = ()=>{
    const [num, setNum] = useState(1);
    return <Context.Provider value={{num}}>
            <OtherComponents />
    </Context.Provider>
}


The dev tool only show the context once. I can not get other context values

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions