Can not find native module ImageColors in react native cli
Closed this issue · 2 comments
mdalishanali commented
In my react native projects, It's thrwoing the error can not find native module ImageColors.
`import {useEffect, useState} from 'react';
import {colors} from '../constants/tokens';
import {getColors} from 'react-native-image-colors';
export const usePlayerBackground = imageUrl => {
const [imageColors, setImageColors] = useState(null);
console.log('imageColors: ', imageColors);
useEffect(() => {
getColors(imageUrl, {
fallback: colors.background,
cache: true,
key: imageUrl,
}).then(colors => setImageColors(colors));
}, [imageUrl]);
return {imageColors};
};
`
jungler132 commented
and? any fix
jungler132 commented
@mdalishanali How did you fixed this bro?