<Hello name={'\u4ed8\u52a0\u4fa1\u5024\u7a0e# IE9834481A'}></Hello>
class Hello extends Component {
render() {
return (
<div>
{this.props.name}
</div>
);
}
}
The above 2 code snippets are working fine & giving the result as expected, i.e, the escape sequences are getting converted to the relevant unicode characters.
Now consider, there is an array(dynamically populated) and the array values will be the default value for the input tag & this array contains unicode escape sequences.
Ex: <input value={array[i]}></input>
I have tried doing <input value={<Hello name={array[i]}></Hello>}></input>
But the o/p is [object Object].
If I hardcode the string in input tag, o/p is as expected
<input value={<Hello name={'\u4ed8\u52a0\u4fa1\u5024\u7a0e'}></Hello>}></input>
How should I solve this issue, ultimately I want to pre-populate input tag with array value containing unicode escape sequences (after converting to unicode characters).