小编Shr*_*hav的帖子

作为断电的一部分,密码身份验证被暂时禁用。请改用个人访问令牌

我使用用户名密码来推送我的代码,它已经工作了几个月,但突然间我无法做到并收到此错误:

Username for 'https://github.com': shreyas-jadhav
Password for 'https://shreyas-jadhav@github.com': 
remote: Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead.
remote: Please see https://github.blog/2020-07-30-token-authentication-requirements-for-api-and-git-operations/ for more information.
Run Code Online (Sandbox Code Playgroud)

请注意,该链接没有帮助。即使使用生成的令牌也无济于事。

主持人注意:这是GitHub 计划中且即将进行的永久性服务更改的一部分

git github token git-pull github-api

237
推荐指数
11
解决办法
10万
查看次数

Next.js 选择退出 _app.js 中特定页面的布局组件

如何不使用布局组件包装特定页面_app.js

例如,我有两个页面 aspages/homepages/about,现在我怎么能不用组件包装我的pages/home页面Layout呢?

页面/_app.js

import "../styles/globals.css";
import Layout from "../components/Layout";

function MyApp({ Component, pageProps }) {

      return (
        <Layout>
          <Component {...pageProps} />
        </Layout>
      );
  
}

export default MyApp;

Run Code Online (Sandbox Code Playgroud)

我尝试过的:

页面/_app.js

function MyApp({ Component, pageProps }) {
  console.log(typeof Component); // gives me a function

  switch (Component) {
    case Home():
      return <Component {...pageProps} />;
    default:
      return (
        <Layout>
          <Component {...pageProps} />{" "}
        </Layout>
      );
  }
}
Run Code Online (Sandbox Code Playgroud)

页面/home.js

import …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs server-side-rendering next.js

32
推荐指数
2
解决办法
3万
查看次数

React 警告 MUI:组件在初始化后正在更改不受控制的 SwitchBase 的默认检查状态

我正在尝试使用默认检查值渲染 mui Switch 组件。但它不起作用,我收到警告。

MUI: A component is changing the default checked state of an uncontrolled SwitchBase after being initialized. To suppress this warning opt to use a controlled SwitchBase. 3 useControlled.js:27
Run Code Online (Sandbox Code Playgroud)

我也尝试过设置checked属性,onChange但仍然不起作用!我不明白我在这里做错了什么。

{details.schedule.days.map((d) => (
                <StyledTableRow>
                  <TableCell>
                    <Typography variant="subtitle1" fontWeight="bold">
                      {d.day}
                    </Typography>
                  </TableCell>
                  <TableCell>
                    <FormControlLabel
                      control={
                        <Switch
                          onChange={(e, checked) => {
                            setDetails((p) => {
                              let prev = { ...p };
                              prev.schedule?.days?.find(
                                (el) =>
                                  el.day === d.day &&
                                  (d.open = e.target.checked)
                              );
                              return prev;
                            });
                          }} …
Run Code Online (Sandbox Code Playgroud)

reactjs material-ui controlled-component

9
推荐指数
2
解决办法
2万
查看次数