mirror of
https://github.com/casdoor/casdoor.git
synced 2025-09-08 12:11:03 +08:00
feat: fix bug that SelfLoginButton will re-render when username field updates (#4091)
This commit is contained in:
@@ -1179,11 +1179,13 @@ class LoginPage extends React.Component {
|
|||||||
{i18next.t("login:Continue with")} :
|
{i18next.t("login:Continue with")} :
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<SelfLoginButton account={this.props.account} onClick={() => {
|
<div onClick={() => {
|
||||||
const values = {};
|
const values = {};
|
||||||
values["application"] = application.name;
|
values["application"] = application.name;
|
||||||
this.login(values);
|
this.login(values);
|
||||||
}} />
|
}}>
|
||||||
|
<SelfLoginButton account={this.props.account} />
|
||||||
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<div style={{fontSize: 16, textAlign: "left"}}>
|
<div style={{fontSize: 16, textAlign: "left"}}>
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import React from "react";
|
import React, {memo} from "react";
|
||||||
import {createButton} from "react-social-login-buttons";
|
import {createButton} from "react-social-login-buttons";
|
||||||
|
|
||||||
class SelfLoginButton extends React.Component {
|
class SelfLoginButton extends React.Component {
|
||||||
@@ -44,4 +44,4 @@ class SelfLoginButton extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default SelfLoginButton;
|
export default memo(SelfLoginButton);
|
||||||
|
Reference in New Issue
Block a user