Typescript React How Implement Decoder And Encoder Difference