Next.js Discord

Discord Forum

view button in sub child component oncleck changing com should be changed and render in parent compo

Unanswered
Horned Grebe posted this in #help-forum
Open in Discord
Horned GrebeOP
in layout.js
<html lang="en" className='{${poppins.variable}'>

<body className={inter.className}>
<LeftPannel/>
<div className='add-tutor'>
<Addtutor/>
</div>
{children}</body>
</html>
----------------------------------------
->LeftPannel.jsx->
{showTutorPannel ?<RightPannel /> : <TutorsPlan /> }


When click on the view the component RightPannel has to change to Tutorsplan component how can I achieve this functionality like passing event from sub child of app-Addtutor-onlinetab-page.js view button
Components to change
-App-RightPannel-RightPannel.js
-Tutorsplan.jsx

Rendering that changing components in
App-Sidebae-Leftpannel.jsx
<button onClick={() => handleButtonClick(tutor)}>View</button>

1 Reply

Horned GrebeOP
Am not getting solution