userInfo.displayName=undefined in the iframe url

I have setup my own server. I was using earlier and userInfo.displayName was working as expected. But as soon as I changed my domain name to my server name, it gets undefined for the URL.
Help me fix it please. Thanks !

It is working if I am hardcoding the value in userInfo displayName but if I am assigning it using javascript variable it isn’t working. Please help

Nevermind fixed it related to state change in react