feat: fix bug that SelfLoginButton will re-render when username field updates (#4091)

This commit is contained in:
DacongDA
2025-08-17 19:50:34 +08:00
committed by GitHub
parent 645716e485
commit c179324de4
2 changed files with 6 additions and 4 deletions

View File

@@ -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"}}>

View File

@@ -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);