MCPcopy
hub / github.com/wcandillon/can-it-be-done-in-react-native / Pixel

Function Pixel

reanimated-2/src/Nokia/Pixel.tsx:31–40  ·  view source on GitHub ↗
({ x, y, snake }: PixelProps)

Source from the content-addressed store, hash-verified

29}
30
31const Pixel = ({ x, y, snake }: PixelProps) => {
32 const style = useAnimatedStyle(() => {
33 const on =
34 eq({ x, y }, snake.value.food) || contains(snake.value.tail, { x, y });
35 return {
36 backgroundColor: on ? ON : OFF,
37 };
38 });
39 return <Animated.View style={[styles.pixel, style]} />;
40};
41
42export default Pixel;

Callers

nothing calls this directly

Calls 2

eqFunction · 0.90
containsFunction · 0.90

Tested by

no test coverage detected