Skip to content

Latest commit

 

History

History
70 lines (54 loc) · 1015 Bytes

README.md

File metadata and controls

70 lines (54 loc) · 1015 Bytes

totopack


Webpack React starter


Global installation

cd totopack
npm install

Docs

Run

To run devServer

npm run start

Build

To build with optionnal subFolder

npm run build
npm run build /subFolder/

Router

// Get a route from the routes.json name
Router.getRoute(name).then((route) => {
	// Goto this route
	Router.goto(route);
});

Router component

// React component for quick links
<RouterComponent route="zozo" params={{id : "1"}} >zozo_link</RouterComponent>

i18n

// Localize a key from a file with a locale (file default is main.json & locale default is current locale)
i18n.localize(key, file, locale);
// Set new locale with promise return when it's done
i18n.setLocale(locale).then();

Localize

// React component to localize a main.json key quickly
<Localize>key<Localize>

LazyImg

// React component to lazyload an image
<LazyImg src="path_to_img" />