react-media 0.0.1

CSS media queries for Haxe React.

Released 2018-01-08.

To install, run:

haxelib install react-media 0.0.1

See using Haxelib in Haxelib documentation for more information.

Maintainerklabz
Websitehttps://github.com/kLabz/haxe-react-media
Current version0.0.1
StatisticsInstalled 6 times
LicenseMIT
Tags

README.md

Haxe react media

A haxe-only version of the react-media npm package, a CSS media query component for React..

A <Media> component listens for matches to a CSS media query and renders stuff based on whether the query matches or not.

Getting Started

Installing

haxelib install react-media

No need for the npm package, this version is haxe-only.

Usage with React

import react.ReactComponent;
import react.ReactMacro.jsx;
import react.media.Media;

class MyComponent extends ReactComponent {
	override public function render() {
		return jsx('
			<div>
				<$Media query="(min-width: 42em)">
					<p>The answer</p>
				</$Media>
			</div>
		');
	}
}

See React-Training/react-media for more documentation.