Current frame: {currentLoopFrame}/{loopFramesLength}
>
);
}
```
--------------------------------
### Simplified Component Assertion with Jest-Enzyme
Source: https://github.com/the-bugging/react-use-presentation/blob/develop/example/README.md
An example showing how to use `jest-enzyme`'s `toContainReact()` matcher for a more concise assertion of component output. This replaces the more verbose `wrapper.contains()` method.
```javascript
expect(wrapper).toContainReact(welcome)
```
--------------------------------
### Define usePresentation Hook Types and Signature
Source: https://github.com/the-bugging/react-use-presentation/blob/develop/README.md
Defines the TypeScript types for `TFrameOptions` and `TUsePresentation`, outlining the expected structure for configuring the `usePresentation` hook. This includes frame configurations, start triggers, delays, and loop settings.
```tsx
type TFrameOptions = {
component: Component | null;
time?: number;
};
type TUsePresentation = {
framesOptions: TFrameOptions[];
startTrigger: boolean;
startDelay?: number;
isLoop?: boolean;
};
usePresentation(TUsePresentation);
```
--------------------------------
### Running Tests Once in Windows Command Prompt
Source: https://github.com/the-bugging/react-use-presentation/blob/develop/example/README.md
Illustrates how to execute tests once and exit in a Windows command prompt environment by setting the `CI` environment variable to `true`. This is useful for CI servers or for ensuring tests run non-interactively.
```cmd
set CI=true&&npm test
```
--------------------------------
### Initializing Flow Configuration
Source: https://github.com/the-bugging/react-use-presentation/blob/develop/example/README.md
Demonstrates the command to initialize Flow's configuration within a project, creating a `.flowconfig` file in the root directory. This file is essential for customizing Flow's behavior and type-checking rules.
```bash
npm run flow init
```
```bash
yarn flow init
```
--------------------------------
### Referencing Environment Variables in Public HTML
Source: https://github.com/the-bugging/react-use-presentation/blob/develop/example/README.md
Illustrates how to embed environment variables directly into your `public/index.html` file using placeholders like `%REACT_APP_WEBSITE_NAME%`. These variables are also injected at build time and must start with `REACT_APP_` (or be built-in like `NODE_ENV`).
```html