Skip to content

Instantly share code, notes, and snippets.

View dagda1's full-sized avatar

Paul dagda1

View GitHub Profile
export async function render({ req, res }: RendererOptions): Promise<void> {
const context: StaticRouterContext = {};
const appString = renderToString(
<StaticRouter location={req.url} context={context}>
<Routes />
</StaticRouter>,
);
const scriptTags = ['vendor', 'client']
export const RouteWrapper = function RouteWrapper<
P = { children?: ReactNode },
TRoute extends RouteProps = Route
>(
Wrapper: React.ComponentType<P | {}>,
RouteType: React.ComponentType<RouteProps> = Route,
options: Partial<TRoute> = {},
wrapperProps: P | {} = {},
) {
return function RouteWrapperResuslt({
{"lastUpload":"2021-01-31T09:57:25.656Z","extensionVersion":"v3.4.3"}
@dagda1
dagda1 / hell.java
Last active October 26, 2019 19:23
@RunWith(Courgette.class)
@CourgetteOptions(
threads = 1,
runLevel = CourgetteRunLevel.FEATURE,
rerunFailedScenarios = true,
showTestOutput = true,
))
public class TestRunner {
}
interface Foo {
value?: string;
}
const item1: Foo = { value: 'foo' }
// ERROR: Object is possibly 'undefined'.
console.log(`Message ${item1.value.substring(4)}`);
const item2 = { value: 'foo' }
process.env.NODE_ENV = 'production';
const webpack = require('webpack');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const webpackConfigProd = require('react-scripts/config/webpack.config')('production');
// this one is optional, just for better feedback on build
const chalk = require('chalk');
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const green = text => {
"exclude": [
"src/**/*.test.ts",
"src/**/*.test.tsx"
]
export enum HexagonType {
flat = 'flat',
pointy = 'pointy'
}
<button class="bg-blue hover:bg-blue-dark text-white font-bold py-2 px-4 rounded">
Button
</button