score:2

the error is not of usereducer but you have wrongly used the export default:

export default function mycom(){

if you want to export named function, then you could do:

// function definition
function mycomp() {}
// then export
export default { mycomp }

then you can use like:

import something from '...'
something.mycomp()

but if there's only one function that you wanted to export then i will do it as:

export const mycomp = () => {}

now, you can import like:

import { mycomp } from '...'
mycomp()

Related Query