MCPcopy Create free account
hub / github.com/dabbott/react-native-express / reducer

Function reducer

examples/files/hooks/useReducer.js:4–11  ·  view source on GitHub ↗
(state, action)

Source from the content-addressed store, hash-verified

2import { View, Text, TextInput } from 'react-native'
3
4function reducer(state, action) {
5 switch (action.type) {
6 case 'first':
7 return { ...state, first: action.value }
8 case 'last':
9 return { ...state, last: action.value }
10 }
11}
12
13export default function App() {
14 const [state, dispatch] = useReducer(reducer, { first: '', last: '' })

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected