Skip to content

Conversation

@quarxz
Copy link
Owner

@quarxz quarxz commented Jan 26, 2024

add button list

Copy link
Collaborator

@Staicy-S Staicy-S left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    • Styling sieht gut aus
    • Für das Button highlighting brauchst du eigentlich einen state 🤭 da musst du nochmal ran

@rsascha
Copy link
Collaborator

rsascha commented Jan 26, 2024

sehr gute Lösung - prima

Copy link
Collaborator

@Staicy-S Staicy-S left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • die buttons solltest du noch nicht in einer externen componente einbauen, da ihr noch kein state uplifting gelernt habt und du wahrscheinlich da nicht weiter kommen wirst 🙈

import { useState } from "react";

export function ButtonBar() {
let [btnHiglight, setBtnHighLight] = useState("");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

die useStates definiert man immer mit const !

}
return (
<>
<div className={styles["btn-comtainer"]}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

container meintest du wahrscheinlich (nicht comtainer)

@rsascha
Copy link
Collaborator

rsascha commented Jan 26, 2024

Die map Funktion für die Buttons zu verwenden ist super.

Ich würde dir aber für heute empfehlen, keine Komponente ButtonBar zu verwenden, da wir die Kommunikation von einer Child-Komponente zur Parent-Komponente noch nicht behandelt haben.

Wenn du dir das Thema "State-Up-Lifting" schon mal anschauen möchtest => https://react.dev/learn/sharing-state-between-components

Sonst schreibe erst mal deinen Code in die App.jsx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants