From 763a4c3756c65038f4616d8c246426d5eefc72da Mon Sep 17 00:00:00 2001 From: "Douglas M." Date: Mon, 26 Aug 2024 11:30:37 +0200 Subject: [PATCH] docs: update state API --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6abd6fd..f0d36f3 100644 --- a/README.md +++ b/README.md @@ -25,18 +25,18 @@ Here's a basic example of how to use Pink: ```gleam import pink import pink/attribute -import pink/hook +import pink/state pub fn main() { // Create a new React component (we need this to use hooks) use <- pink.component() // Initialize a state (this is React's useState hook) - let message = hook.state("World") + let message = state.init("World") // Create a box with a border and a text component inside pink.box([attribute.border_style(attribute.BorderSingle)], [ - pink.text([], "Hello, " <> message.value) + pink.text([], "Hello, " <> state.get(message)) ]) } ```