WaspNetwork Posted January 31, 2021 Posted January 31, 2021 (edited) Hello, I've been facing a problem while using ExecuteJs() with a ReactJs application. I'm getting this error in cef_game_logs.txt: [0131/163336.765:INFO:CONSOLE(1)] "Uncaught ReferenceError: handleWrongPassword is not defined", source: (1) Is everything fine in my ClientSide code aswell as in ServerSide? ClientSide code: // In Main class: public Main() { Browser.Create(); Events.Add("WrongPassword", ShowWrongPassword); // other events } private void ShowWrongPassword(object[] args) { bool isWrong = (bool)args[0]; Browser.ExecuteJs("handleWrongPassword",isWrong.ToString()); } // In Browser class: public static void ExecuteJs(string functionName, [Optional] string formattedArgs) { Cef.ExecuteJs($"{functionName}({formattedArgs})"); } ServerSide code: NAPI.ClientEventThreadSafe.TriggerClientEvent(player, "WrongPassword", true); ReactJs code: const Login = () => { const [isWrongPassword, setIsWrongPassword] = useState(false); const handleWrongPassword = (isWrong: boolean) => { setIsWrongPassword(isWrong); }; ... return // some components } Edited January 31, 2021 by WaspNetwork
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now