Skip to content

Commit

Permalink
Fix navigateTo lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jho406 committed Dec 31, 2024
1 parent f1d95ff commit e31381f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion superglue/lib/components/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const notFound = (identifier: string | undefined): never => {

const NavigationProvider = forwardRef(function NavigationProvider(
{ history, visit, remote, mapping }: NavigationProviderProps,
ref: ForwardedRef<{ navigateTo: NavigateTo }>
ref: ForwardedRef<{ navigateTo: NavigateTo | null }>
) {
const dispatch = useDispatch()
const pages = useSelector<RootState, AllPages>((state) => state.pages)
Expand Down
2 changes: 1 addition & 1 deletion superglue/lib/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function Application({
mapping,
...rest
}: ApplicationProps) {
const navigatorRef = useRef<{ navigateTo: NavigateTo }>(null)
const navigatorRef = useRef<{ navigateTo: NavigateTo } | null>(null)

const { visit, remote, nextHistory, initialPageKey, ujs } = useMemo(() => {
return setup({
Expand Down
4 changes: 2 additions & 2 deletions superglue/lib/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ export interface BuildStore {
*/
export interface BuildVisitAndRemote {
(
navigatorRef: React.RefObject<{ navigateTo: NavigateTo }>,
navigatorRef: React.RefObject<{ navigateTo: NavigateTo } | null>,
store: SuperglueStore
): {
visit: ApplicationVisit
Expand Down Expand Up @@ -507,7 +507,7 @@ export interface SetupProps {
*/
navigatorRef: React.RefObject<{
navigateTo: NavigateTo
}>
} | null>
}

/**
Expand Down

0 comments on commit e31381f

Please sign in to comment.