Skip to content

Commit 4eb7903

Browse files
committed
Add input prefix arg for render func
1 parent 4aeebca commit 4eb7903

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "beanhub-web-react",
3-
"version": "0.3.6",
3+
"version": "0.3.7",
44
"private": false,
55
"dependencies": {
66
"@testing-library/jest-dom": "^5.14.1",

src/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@ import { ThemeConfig, defaulThemeConfig } from "./Theme/types";
1212
import TransactionForm, {
1313
Props as TransactionFormProps,
1414
} from "./TransactionForm/Form";
15+
import { InputPrefixContext } from "./TransactionForm/context";
1516

1617
// TODO: maybe there's a better way to expose it?
1718
(window as any).renderTransactionForm = (
1819
element: HTMLElement,
19-
props: TransactionFormProps
20+
props: TransactionFormProps,
21+
inputPrefix?: string
2022
) => {
2123
ReactDOM.render(
2224
<React.StrictMode>
23-
<TransactionForm {...props} />
25+
<InputPrefixContext.Provider value={inputPrefix ?? ""}>
26+
<TransactionForm {...props} />
27+
</InputPrefixContext.Provider>
2428
</React.StrictMode>,
2529
element
2630
);

0 commit comments

Comments
 (0)