You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to tell flow that a dynamic string is just like a normal string #9253
changed the title [-]How to tell flow that a ``tempalte_string`` is the same as `'tempalte_string'`[/-][+]How to tell flow that a `\`template_string\`` is the same as `'template_string'`[/+]on Feb 3, 2025
changed the title [-]How to tell flow that a `\`template_string\`` is the same as `'template_string'`[/-][+]How to tell flow that a ````template_string```` is the same as `'template_string'`[/+]on Feb 3, 2025
changed the title [-]How to tell flow that a ````template_string```` is the same as `'template_string'`[/-][+]How to tell flow that a ```\`template_string\```` is the same as `'template_string'`[/+]on Feb 3, 2025
changed the title [-]How to tell flow that a ```\`template_string\```` is the same as `'template_string'`[/-][+]How to tell flow that a ` \`template_string\` ` is the same as `'template_string'`[/+]on Feb 3, 2025
changed the title [-]How to tell flow that a ` \`template_string\` ` is the same as `'template_string'`[/-][+]How to tell flow that a `template_string` is the same as `'template_string'`[/+]on Feb 3, 2025
changed the title [-]How to tell flow that a `template_string` is the same as `'template_string'`[/-][+]How to tell flow that a ```template_string```` is the same as `'template_string'`[/+]on Feb 3, 2025
changed the title [-]How to tell flow that a ```template_string```` is the same as `'template_string'`[/-][+]How to tell flow that a \`template_string\` is the same as `'template_string'`[/+]on Feb 3, 2025
changed the title [-]How to tell flow that a \`template_string\` is the same as `'template_string'`[/-][+]How to tell flow that a dynamic string is just like a normal string[/+]on Feb 3, 2025
This is a result of our contextual typing heuristics. For now, we only use specific syntactic patterns (e.g. only literal) to help pick one of the disjoint union.
There might be something we can do better here, since TS is able to do that.
Activity
[-]How to tell flow that a ``tempalte_string`` is the same as `'tempalte_string'`[/-][+]How to tell flow that a `\`template_string\`` is the same as `'template_string'`[/+][-]How to tell flow that a `\`template_string\`` is the same as `'template_string'`[/-][+]How to tell flow that a ````template_string```` is the same as `'template_string'`[/+][-]How to tell flow that a ````template_string```` is the same as `'template_string'`[/-][+]How to tell flow that a ```\`template_string\```` is the same as `'template_string'`[/+][-]How to tell flow that a ```\`template_string\```` is the same as `'template_string'`[/-][+]How to tell flow that a ` \`template_string\` ` is the same as `'template_string'`[/+][-]How to tell flow that a ` \`template_string\` ` is the same as `'template_string'`[/-][+]How to tell flow that a `template_string` is the same as `'template_string'`[/+][-]How to tell flow that a `template_string` is the same as `'template_string'`[/-][+]How to tell flow that a ```template_string```` is the same as `'template_string'`[/+][-]How to tell flow that a ```template_string```` is the same as `'template_string'`[/-][+]How to tell flow that a \`template_string\` is the same as `'template_string'`[/+][-]How to tell flow that a \`template_string\` is the same as `'template_string'`[/-][+]How to tell flow that a dynamic string is just like a normal string[/+]SamChou19815 commentedon Feb 3, 2025
This is a result of our contextual typing heuristics. For now, we only use specific syntactic patterns (e.g. only literal) to help pick one of the disjoint union.
There might be something we can do better here, since TS is able to do that.
buschco commentedon Mar 10, 2025
A workaround could be setting the prop twice:
e.g.
https://flow.org/try/#1N4Igxg9gdgZglgcxALlAIwIZoKYBsD6uEEAztvhgE6UYCe+JADpdhgCYowa5kA0I2KAFcAtiRQAXSkOz9sADwxgJ+NPTbYuQ3BMnTZA+Y2yU4IwRO4A6SFBIrGVDGM7c+h46fNRLuKxJIGWh8MeT0ZfhYlCStpHzNsFBAMIQkIEQwJODAQfiEyfBE4eWw2fDgofDBMsAALfAA3KjgsXGxxZC4eAw0G-GhcWn9aY3wWZldu-g1mbGqJUoBaCRHEzrcDEgBrbAk62kXhXFxJ923d-cPRHEpTgyEoMDaqZdW7vKgoOfaSKgOKpqmDA+d4gB5fMA-P6LCCMLLQbiLOoYCqgh6-GDYRYIXYLSgkRZkCR4jpddwPfJLZjpOBkO4AX34kA0SRWxgABAAFSiwkjsgC87IAJAAlVhsADyUEGAB5gAAdKDs5Xs6JwaAASTYyHZ9lMUAQvEVKvZ0G5Px1AAoqAgSKg2LTHHtalaAJQCgB87IaEDgbHp7v5Xp9fsV9K9AB9hWL2FLZQqlSq1Zq2AB+ZAhthGxPKs0sEh29mWwPB31sMMexWK2z2dkAQStjGQ3N5Je9ZYFRbbwHpVce0FryagWp1eoqCE7AAMAIyTvt1y0Jk1DkfsgDka+zy+U6uHWeNKrzFsXDqYNVqAc97OAp6ddWLvagAfni4PypX2vXm7fqp3KZ1G42NA8yWhurpboeUDmgWyAno656XkG163ueD5hq6L5Lkmf57gB07fjmppQfmdpwWezqIV6N7wc6aFPq6uQgA0JgkLuSQNAADFYABMABsADMVgcSA9JAA