Skip to content

Commit

Permalink
fix missing encoder option (#66)
Browse files Browse the repository at this point in the history
* missing encoder option

* bump version
  • Loading branch information
seokju-na authored Jan 3, 2024
1 parent 9e6f114 commit 0970aab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .yarn/versions/772c6cd9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
releases:
react-thermal-printer: patch
12 changes: 10 additions & 2 deletions packages/react-thermal-printer/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,16 @@ type PrinterProps = ComponentProps<typeof Printer>;
* Render the React element as printable binary data.
*/
export async function render(elem: ReactElement<PrinterProps>): Promise<Uint8Array> {
const { type, characterSet, width = 48, initialize = true, debug = false, children } = elem.props;
const printer = getPrinter({ type, characterSet });
const {
type,
characterSet,
width = 48,
encoder,
initialize = true,
debug = false,
children,
} = elem.props;
const printer = getPrinter({ type, characterSet, encoder });

if (characterSet != null) {
printer.setCharacterSet(characterSet);
Expand Down

0 comments on commit 0970aab

Please sign in to comment.