This is my code:
a.tsx
const initialState = {
open: false
}
export const a = createSlice({
name: 'a',
initialState,
reducers: {
show: (state) => {
state.open = true
}
}
});
export const {show} = a.actions;
export default a.reducer;
b.tsx
const initialState = {
open: false
}
export const b = createSlice({
name: 'b',
initialState,
reducers: {
show: (state) => {
state.open = true
}
}
});
export const {show} = b.actions;
export default b.reducer;
app.tsx
import { show } from './app/reducer/a'
import { show } from './app/reducer/b';
And I get this error:
Duplicate identifier 'show'
I don't want to change method name to showA and showB.
How can I handle same name of functions?