react-native-camera-kit
react-native-camera-kit copied to clipboard
Pass Component as icons.
https://github.com/teslamotors/react-native-camera-kit/blob/feacdfb0bfb4e94abfa795719dac24152214b92d/src/CameraScreen.tsx#L135
RN-Camera-Kit should let the developer pass a Component over a string for icons. This is useful when using libraries like react-native-vector-icons. Example:
<CameraScreen
.....
torchOffImage={<MaterialCommunityIcons name="torch" />}
/>
EDIT: I'm actually working on a PR for this request :)
@aarongrider Hi Aaron, I'm actually having some problems after cloning the repository (probably something missing).
-
On each
react-native
import, I get this error:Parse errors in imported module 'react-native': ';' expected. (13:32)eslintimport/namespace
Parse errors in imported module 'react-native': ';' expected. (13:32)eslintimport/named
-
Also, foreach
import Camera from './Camera';
I'm getting this: Cannot find module './Camera' or its corresponding type declarations.
The first one seems a problem relative to eslint, just found out that removing 'import/named': 'error'
and 'import/namespace': 'error'
from .eslintrc.js solves the problem (Is there a different way? Am I missing something?)
The second error seems something about platform-specific extensions
, as if TypeScript cannot understand what is going on.
I'm using TypeScript 4.1.2.
What am I missing?
Hey @codakkk, are you trying to run the example project or are you adding camera-kit to your existing project?
You will want to either:
- clone this project if you are running the example
- manually add camera-kit from GitHub
"react-native-camera-kit": "git+https://github.com/teslamotors/react-native-camera-kit.git"
We haven't published the latest in master to npm yet. We will be publishing a v11 release in the next few weeks once we have have had sufficient time to finish testing.
Hey @codakkk, are you trying to run the example project or are you adding camera-kit to your existing project?
You will want to either:
- clone this project if you are running the example
- manually add camera-kit from GitHub
"react-native-camera-kit": "git+https://github.com/teslamotors/react-native-camera-kit.git"
We haven't published the latest in master to npm yet. We will be publishing a v11 release in the next few weeks once we have have had sufficient time to finish testing.
The example is working right now. I'm trying to add the feature described in the issue, the fact is there are those errors I can't get over.
Change your package.json try changing from "react-native-camera-kit": 10.0.0
-> "react-native-camera-kit": "git+https://github.com/teslamotors/react-native-camera-kit.git"
Change your package.json try changing from
"react-native-camera-kit": 10.0.0
->"react-native-camera-kit": "git+https://github.com/teslamotors/react-native-camera-kit.git"
Some misunderstanding happening here 😄 I actually want to implemente the feature described in the issue, placing components over just texts on Icons. The fact is, when I clone the repository, the errors I wrote in my past replies happens.
I pushed a PR (#378) for this Issue