Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
<h1>Hello World!</h1>
);
const Foo = () => (
<h1>Hello Foo!</h1>
);
const App = () => (
);
export default render(, createContext({
reducers: {
foo: function (state, action) {
// console.log(state, action);
return Object.assign({}, state);
}
},
actionCreators: {
'/:foo': function (params, location) {
return function (dispatch) {
console.log(params, location);
};
}
}
}));
// @flow
import {
combineContexts,
contextDefinition as reactContext
} from 'hops-react';
import {
contextDefinition as reduxContext
} from 'hops-redux';
import {
contextDefinition as graphqlContext
} from 'hops-graphql';
export default combineContexts(
reactContext,
reduxContext,
graphqlContext
);
},
]),
});
}.bind(this)
);
},
prefetchData: function(rootElement) {
return process.env.HOPS_MODE !== 'static'
? ReactApollo.getDataFromTree(rootElement)
: Promise.resolve();
},
});
exports.contextDefinition = exports.GraphQLContext;
exports.createContext = hopsReact.combineContexts(
hopsReact.ReactContext,
exports.GraphQLContext
);
exports.graphqlExtension = function(config) {
return {
context: exports.GraphQLContext,
config: {
graphql: config,
},
};
};
return common.constructor.apply(this, arguments);
};
exports.GraphQLContext.prototype = Object.assign({}, common, {
createCache: function() {
return common.createCache
.call(this)
.restore(global[constants.APOLLO_STATE]);
},
getIntrospectionResult: function() {
return global[constants.APOLLO_IQRD];
},
});
exports.contextDefinition = exports.GraphQLContext;
exports.createContext = hopsReact.combineContexts(
hopsReact.ReactContext,
exports.GraphQLContext
);
exports.graphqlExtension = function(config) {
return {
context: exports.GraphQLContext,
config: {
graphql: config,
},
};
};
};
exports.GraphQLContext.prototype = Object.assign({}, common, {
createCache: function() {
return common.createCache
.call(this)
.restore(global[constants.APOLLO_STATE]);
},
getIntrospectionResult: function() {
return global[constants.APOLLO_IQRD];
},
});
exports.contextDefinition = exports.GraphQLContext;
exports.createContext = hopsReact.combineContexts(
hopsReact.ReactContext,
exports.GraphQLContext
);
exports.graphqlExtension = function(config) {
return {
context: exports.GraphQLContext,
config: {
graphql: config,
},
};
};
]),
});
}.bind(this)
);
},
prefetchData: function(rootElement) {
return process.env.HOPS_MODE !== 'static'
? ReactApollo.getDataFromTree(rootElement)
: Promise.resolve();
},
});
exports.contextDefinition = exports.GraphQLContext;
exports.createContext = hopsReact.combineContexts(
hopsReact.ReactContext,
exports.GraphQLContext
);
exports.graphqlExtension = function(config) {
return {
context: exports.GraphQLContext,
config: {
graphql: config,
},
};
};
import React from 'react';
import { Switch, Route } from 'react-router-dom';
import { Miss, render, createContext } from 'hops-react';
import { headline } from './style.css';
const Home = () => <h1>Hello World!</h1>;
const App = () => (
);
export default render(, createContext());