View Stylable.js
// @flow
import React from "react"
import Hoverable from "../../modules/Hoverable"
import Focusable from "../../modules/Focusable"
import Touchable from "../../modules/Touchable"
type PropsType = {
children?: React$Element<any>,
View webpack.config.babel.js
import path from "path"
import webpack from "webpack"
import ExtractTextPlugin from "extract-text-webpack-plugin"
import { phenomicLoader } from "phenomic"
import PhenomicLoaderFeedWebpackPlugin
from "phenomic/lib/loader-feed-webpack-plugin"
import pkg from "./package.json"
View markdown-no-heading-anchor.js
import remark from "remark"
import slug from "remark-slug"
import autoLinkHeadings from "remark-autolink-headings"
import highlight from "remark-highlight.js"
import toc from "remark-toc"
import html from "remark-html"
function mdify(text) {
return remark()
// https://github.com/wooorm/remark-slug
View Hoverable.js
// @flow
import React, { Component } from "react"
type Props = {
onMouseEnter?: Function | boolean,
onMouseLeave?: Function | boolean,
}
type State = {
View compo.js
import React, { Component } from "react"
class Test extends Component {
handleThing = () => {
this.setState({
// ...
})
};
render() {
View .flowconfig
[version]
0.30.0
[ignore]
.*/.git/.*
.*/node_modules/.*
.*/.nyc_output/.*
.*/__tests__/.*
.*/dist/.*
View solution1.js
import React, { Component } from "react"
import styles from "./index.css"
export default class Hero extends Component {
componentDidMount() {
if (typeof window !== "undefined") {
require("particles.js").particlesJS.load("particles-js", "assets/particles.json", function() {
console.log("callback - particles.js config loaded")
View index.web.js
// @flow
// partial dirty implementation of react-native Picker
// should match http://facebook.github.io/react-native/docs/picker.html
// https://github.com/necolas/react-native-web/issues/184
import createDOMElement from "react-native-web/dist/modules/createDOMElement"
import PickerItem from "./item.web.js"
View cancelable-promise.js
// @flow
// https://facebook.github.io/react/blog/2015/12/16/ismounted-antipattern.html
export type CancelablePromise = {
promise: Promise<any>,
cancel: Function,
}
export const makeCancelablePromise = (
View package.json.js
{
"private": true,
// ...
"#dependencies": "dependencies are the one shipped to the client",
"dependencies": {
"babel-polyfill": "^6.7.4",
"react": "^15.0.0",
// ...
"whatwg-fetch": "^0.11.1"
},