Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Nomenclature(props) {
- const [isAddOpen, setIsAddOpen] = useState(false);
- const [isEditModalOpen, setIsEditModalOpen] = useState(false);
- const routeParams = useLocation();
- const classes = useStyles();
- const [currentType, setCurrentType] = useState('');
- const [tableTitle, setTableTitle] = useState('');
- const path = routeParams.pathname.split('/');
- const type = path[path.length - 1];
- let currentList = [];
- useEffect(() => {
- if (type === '1') {
- store.dispatch(Actions.get1Types());
- currentList = 1List;
- setCurrentType(1);
- } else if (type === '2') {
- store.dispatch(Actions.get2Types());
- currentList = 2List;
- setCurrentType(2);
- }, []);
- const 1List = useSelector(({ rew }) => rew.1Types);
- const 2List = useSelector(({ rew }) => rew.2Types);
- console.log(currentList);
Advertisement
Add Comment
Please, Sign In to add comment