Open
Conversation
added 2 commits
March 31, 2020 01:17
kybarg
requested changes
Apr 4, 2020
Owner
kybarg
left a comment
There was a problem hiding this comment.
What do you think if we refactor component as well to use hook api? Cause now I see we have same code copied, at least we can make Component and Hook to share same code base
|
|
||
| export default BarcodeScanner No newline at end of file | ||
| export { default as BarcodeScanner } from './BarcodeScanner'; | ||
| export { default as useBarcodeScanner } from './useBarcodeScanner'; |
Owner
There was a problem hiding this comment.
Maybe we should add export default BarcodeScanner not to break previous api
Author
There was a problem hiding this comment.
That's fine as well, I was just giving an option so people can import like this
import {BarcodeScanner, useBarcodeScanner} from 'react-barcode-scanner'
But yeah, I didn't think about it when I made this change. I'll fix it.
Author
There was a problem hiding this comment.
Refactoring the component or the hook is totally up to you.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Keep the original BarcodeScanner component and introduce new React hook useBarcodeScanner.