📜  带有 redux 的 getstaticpaths - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:34.427000             🧑  作者: Mango

代码示例1
import store from '.../store';

export const getStaticPaths: GetStaticPaths = async () => {
  const state = store.getState();

  const paths = state.user.users.map((user) => {
    return (
      {params: {username: user.username}}
    );
  });

  return {paths, fallback: false}
};