react-media

CSS media queries for Haxe React.
https://github.com/kLabz/haxe-react-media

To install, run:

haxelib install react-media 0.0.1 

See using Haxelib in Haxelib documentation for more information.

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.

Contributors
klabz
Version
0.0.1
Published
5 months ago
License
MIT

All libraries are free

Every month, more than thousand developers use haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on Github!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on Github