From b15a982cc6b3998bd63fdc05610ee62f6ae16731 Mon Sep 17 00:00:00 2001 From: Marco de Jongh Date: Mon, 17 Sep 2018 11:37:16 +1000 Subject: [PATCH] Make first example a bit more easily copy-pastable Adding the import so first users don't have to figure out if it's exported as default, * or as a names export. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d97d0c8..2759720 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ Resolve components asynchronously, with support for code splitting and advanced [![Codecov](https://img.shields.io/codecov/c/github/ctrlplusb/react-async-component.svg?style=flat-square)](https://codecov.io/github/ctrlplusb/react-async-component) ```jsx +import { asyncComponent } from "react-async-component"; + const AsyncProduct = asyncComponent({ resolve: () => System.import('./Product'), LoadingComponent: ({ productId }) =>
Loading {productId}
, // Optional