Create codemod for addressing ESLint warnings (#10032)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React from 'react'
|
||||
import {createContext, useContext, useMemo} from 'react'
|
||||
import {type SharedValue, useSharedValue} from 'react-native-reanimated'
|
||||
|
||||
type StateContext = {
|
||||
@@ -6,7 +6,7 @@ type StateContext = {
|
||||
footerHeight: SharedValue<number>
|
||||
}
|
||||
|
||||
const stateContext = React.createContext<StateContext>({
|
||||
const stateContext = createContext<StateContext>({
|
||||
headerHeight: {
|
||||
value: 0,
|
||||
addListener() {},
|
||||
@@ -34,7 +34,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
||||
const headerHeight = useSharedValue(0)
|
||||
const footerHeight = useSharedValue(0)
|
||||
|
||||
const value = React.useMemo(
|
||||
const value = useMemo(
|
||||
() => ({
|
||||
headerHeight,
|
||||
footerHeight,
|
||||
@@ -46,5 +46,5 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
||||
}
|
||||
|
||||
export function useShellLayout() {
|
||||
return React.useContext(stateContext)
|
||||
return useContext(stateContext)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user