# react-mounter-aphrodite

> React Mounter lets you mount React components to DOM easily with Aphrodite.

Latest version **1.3.2** (published 2016-05-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-mounter-aphrodite
pnpm add react-mounter-aphrodite
yarn add react-mounter-aphrodite
bun add react-mounter-aphrodite
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.2 |
| Published | 2016-05-04 |
| First published | 2016-04-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | sammkj |

## Links

- npm: https://www.npmjs.com/package/react-mounter-aphrodite
- Repository: https://github.com/sammkj/react-mounter-aphrodite
- Homepage: https://github.com/sammkj/react-mounter-aphrodite#readme
- Issues: https://github.com/sammkj/react-mounter-aphrodite/issues
- npm.io page: https://npm.io/package/react-mounter-aphrodite

## Dependencies (2)

- [domready](https://npm.io/package/domready.md) 1.x.x
- [babel-runtime](https://npm.io/package/babel-runtime.md) 6.x.x

## Recent versions

- 1.3.2 (latest) — 2016-05-04
- 1.3.1 — 2016-05-04
- 1.3.0 — 2016-04-29

## README

# React Mounter Aphrodite

React Mounter Aphrodite lets you mount React components to DOM easily with Aphrodite.

> React Mounter Aphrodite supports Server Side Rendering when used with [FlowRouter](https://github.com/kadirahq/flow-router).
> If you're not using Aphrodite, use react-mounter instead.

React Mounter Aphrodite can work as a simple Layout Manager where you can use with [Flow Router](https://github.com/kadirahq/flow-router).

## Basic Usage

Install with:

```
npm i --save react-mounter-aphrodite react react-dom aphrodite
```

> `aphrodite`, `react` and `react-dom` are peerDependencies of `react-mounter-aphrodite`. So, you need to install them into your app manually.

Create a component with styles:

```
import React, { PropTypes } from 'react';
import { StyleSheet, css } from 'aphrodite';

const styles = StyleSheet.create({
  red: {
    backgroundColor: 'red',
    height: '300px',
    '@media (min-width: 400px)': {
      backgroundColor: 'blue',
    },
  },
  random: {
    backgroundColor: 'blue',
  },
});

const Hello = ({ name }) => (
  <div className={css(styles.red)}>
    <div className={css(styles.random)}>hello {name()}</div>
  </div>
);

```

Rehyrate style tag on client-side (if you use SSR)

```
if (Meteor.isClient) {
  StyleSheet.rehydrate(window.renderedClasses);
}
```

Mount the component.

```
import React from 'react';
import Hello from '../hello';
import { mount } from 'react-mounter';

mount(Hello, { name: 'Sam' });
```

## Configure Root DOM node

By default React Mounter render our components into a DOM node called `react-root`. But, you can configure if by like below:

```js
const {mount, withOptions} from `react-mounter`;
const mount2 = withOptions({
    rootId: 'the-root',
    rootProps: {'className': 'some-class-name'}
}, mount);

mount2(WelcomeComponent, {name: 'Arunoda'});
```

## Server Side Rendering (SSR)

SSR is supported when used with [FlowRouter SSR](https://github.com/kadirahq/flow-router/tree/ssr). Checkout this [sample app](https://github.com/kadira-samples/meteor-data-and-react).

---
_Source: https://npm.io/package/react-mounter-aphrodite · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
