Skip to content

Commit

Permalink
Merge pull request #7 from ghivert/fix/use-callback
Browse files Browse the repository at this point in the history
Use correct type for use_callback
  • Loading branch information
ghivert authored Aug 21, 2024
2 parents d91e2e1 + 2a5405e commit d93cb62
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion redraw/src/redraw.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ pub fn suspense(props: Suspense, children: List(Component)) -> Component
///
/// [Documentation](https://react.dev/reference/react/useCallback)
@external(javascript, "react", "useCallback")
pub fn use_callback(fun: function, dependencies: dependencies) -> a
pub fn use_callback(fun: function, dependencies: dependencies) -> function

/// Let you add a label to a custom Hook in React DevTools.
///
Expand All @@ -203,6 +203,13 @@ pub fn use_deferred_value(value: a) -> a
@external(javascript, "react", "useEffect")
pub fn use_effect(value: fn() -> Nil, dependencies: a) -> Nil

/// Let you synchronize a component with an external system. Allow to return
/// a cleanup function.
///
/// [Documentation](https://react.dev/reference/react/useEffect)
@external(javascript, "react", "useEffect")
pub fn use_effect_(value: fn() -> fn() -> Nil, dependencies: a) -> Nil

/// Version of useEffect that fires before the browser repaints the screen.
///
/// [Documentation](https://react.dev/reference/react/useLayoutEffect)
Expand Down

0 comments on commit d93cb62

Please sign in to comment.