React npm Portlet

The React npm Portlet sample provides a portlet that uses the React framework to render its output.

Figure 1: You can play the game Tic-tac-toe with this sample portlet.

Figure 1: You can play the game Tic-tac-toe with this sample portlet.

This portlet showcases the how efficiently React can render components based on user interaction.

Important: This sample works for Liferay DXP 7.0 Fix Pack 44+ and Liferay Portal CE GA7+.

What API(s) and/or code components does this sample highlight?

This sample leverages the npm development workflow support.

How does this sample leverage the API(s) and/or code component?

This sample uses the npm registry to download project dependencies and uses the liferay-npm-bundler tool to bundle the project dependencies inside the OSGi bundle JAR file.

To accomplish the bundling, the project’s build process relies on a build script inside its package.json file:

"scripts": {
    "build": "babel --source-maps -d build/resources/main/META-INF/resources src/main/resources/META-INF/resources && liferay-npm-bundler"
},

Where Is This Sample?

This sample is built with the following build tool:

« Metal.js npm PortletSimple npm Portlet »
この記事は役に立ちましたか?
1人中0人がこの記事が役に立ったと言っています