Check out example codes for "typescript string to string literal". It will help you in understanding the concepts better.

Code Example 1

// stringLiteral is type of 'someString', not string
const stringLiteral = 'someString' as 'someString';

Learn ReactJs, React Native from akashmittal.com