mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 10:50:14 +01:00
handle textarea text state with redux and setText on example click
This commit is contained in:
parent
581ee0e2ca
commit
5cd50e7826
4 changed files with 41 additions and 8 deletions
19
src/store/textSlice.js
Normal file
19
src/store/textSlice.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { createSlice } from '@reduxjs/toolkit';
|
||||
|
||||
const initialState = {
|
||||
text: '',
|
||||
};
|
||||
|
||||
const currentSlice = createSlice({
|
||||
name: 'text',
|
||||
initialState,
|
||||
reducers: {
|
||||
setText: (state, action) => {
|
||||
state.text = action.payload;
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
export const { setText } = currentSlice.actions;
|
||||
|
||||
export default currentSlice.reducer;
|
||||
Loading…
Add table
Add a link
Reference in a new issue