Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React, { useState } from 'react';
import { Button, Text } from 'react-native';
import { useCavy, wrap } from 'cavy';
export const key = 'ButtonFunctionComponent';
const buttonId = `${key}.Button`;
const textId = `${key}.Text`;
const FunctionButton = ({ onPress, title }) => (
<button title="{title}">
);
const WrappedFunctionButton = wrap(FunctionButton);
export const Screen = () => {
const [showHiddenMessage, setShowHiddenMessage] = useState(false);
const generateTestHook = useCavy();
return (
<>
setShowHiddenMessage(true)}
/>
{showHiddenMessage && (
</button>
export default ({ data, navigation }) => {
const generateTestHook = useCavy();
const WrappedText = wrap(Text);
return (
navigation.navigate('EmployeeDetails', {employeeId: data.id}) }
underlayColor={'#EEEEEE'}>
render() {
const TestableActionButton = wrap(ActionButton);
return (
);
}
}