Skip to content

Commit

Permalink
fix: change callback type to React.EffectCallback (#10)
Browse files Browse the repository at this point in the history
* fix: change callback type to React.EffectCallback

* fix: import the type directly
  • Loading branch information
wad4444 authored Apr 14, 2024
1 parent 6bf4723 commit edf3dbf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/use-mount-effect/use-mount-effect.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useEffect } from "@rbxts/react";
import { EffectCallback, useEffect } from "@rbxts/react";

/**
* Runs a callback when the component is mounted.
* @param callback The callback to run.
*/
export function useMountEffect(callback: () => void) {
export function useMountEffect(callback: EffectCallback) {
useEffect(callback, []);
}

0 comments on commit edf3dbf

Please sign in to comment.