open-index/open-npm huggingface dataset:
npm package: @pvinis/react-conditional-wrap
Description: A simple component that helps you easily wrap components with other components, contidionally.
Author: Pavlos Vinieratos
Latest version: 1.0.1

# react-conditional-wrap

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


## Installation

```sh
npm install 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 (
    <Wrap if={show}>
      <div style={{ backgroundColor: "pink" }}>
        <Wrap.Content>
          <div>Hello World</div>
        </Wrap.Content>
      </div>
    </Wrap>
  )
}
```