Create codemod for addressing ESLint warnings (#10032)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React from 'react'
|
||||
import {createContext, useContext, useReducer} from 'react'
|
||||
import {
|
||||
type AppBskyFeedDefs,
|
||||
type AppBskyGraphDefs,
|
||||
@@ -41,12 +41,12 @@ interface State {
|
||||
|
||||
type TStateContext = [State, (action: Action) => void]
|
||||
|
||||
const StateContext = React.createContext<TStateContext>([
|
||||
const StateContext = createContext<TStateContext>([
|
||||
{} as State,
|
||||
(_: Action) => {},
|
||||
])
|
||||
StateContext.displayName = 'StarterPackWizardStateContext'
|
||||
export const useWizardState = () => React.useContext(StateContext)
|
||||
export const useWizardState = () => useContext(StateContext)
|
||||
|
||||
function reducer(state: State, action: Action): State {
|
||||
let updatedState = state
|
||||
@@ -157,7 +157,7 @@ export function Provider({
|
||||
}
|
||||
}
|
||||
|
||||
const [state, dispatch] = React.useReducer(reducer, null, createInitialState)
|
||||
const [state, dispatch] = useReducer(reducer, null, createInitialState)
|
||||
|
||||
return (
|
||||
<StateContext.Provider value={[state, dispatch]}>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React from 'react'
|
||||
import {useCallback, useEffect} from 'react'
|
||||
import {Keyboard, View} from 'react-native'
|
||||
import {KeyboardAwareScrollView} from 'react-native-keyboard-controller'
|
||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||
@@ -179,14 +179,14 @@ function WizardInner({
|
||||
})
|
||||
const parsed = parseStarterPackUri(currentStarterPack?.uri)
|
||||
|
||||
React.useEffect(() => {
|
||||
useEffect(() => {
|
||||
navigation.setOptions({
|
||||
gestureEnabled: false,
|
||||
})
|
||||
}, [navigation])
|
||||
|
||||
useFocusEffect(
|
||||
React.useCallback(() => {
|
||||
useCallback(() => {
|
||||
setMinimalShellMode(true)
|
||||
|
||||
return () => {
|
||||
|
||||
Reference in New Issue
Block a user