generated from Tinkoff/angular-open-source-starter
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(demo): add description how to merge Maskito React ref with othe…
…r 3d-party refs
- Loading branch information
1 parent
6b517db
commit e78c57a
Showing
3 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
projects/demo/src/pages/frameworks/react/examples/merge-ref.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
```tsx | ||
import {useMaskito} from '@maskito/react'; | ||
|
||
const options: MaskitoOptions = { | ||
mask: /^\d+$/, | ||
}; | ||
|
||
function App() { | ||
const anyExternalRef = useRef(null); | ||
const maskitoRef = useMaskito({options}); | ||
|
||
return ( | ||
<input | ||
ref={(node) => { | ||
maskitoRef(node); | ||
myInputRef.current = node; | ||
}} | ||
/> | ||
); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters