Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pvinis/react-conditional-wrap

A simple component that helps you easily wrap components with other components, conditionally.
https://github.com/pvinis/react-conditional-wrap

conditional-rendering react wrap

Last synced: about 1 month ago
JSON representation

A simple component that helps you easily wrap components with other components, conditionally.

Awesome Lists containing this project

README

        

# react-conditional-wrap

A simple component that helps you easily wrap components with other components, conditionally.

## Installation

```sh
npm install @pvinis/react-conditional-wrap
or
npx jsr add @pvinis/react-conditional-wrap
```

## Usage

- Anything inside `Wrap.Content` will always be rendered.
- Anything between `Wrap` and `Wrap.Content` will only be rendered if the `if` prop is `true`.

```jsx
import { Wrap } from 'react-conditional-wrap'

function MyComponent() {
const [show, setShow] = useState(true)

return (



Hello World




)
}
```