Edit

Share via


Module view file

The Retail Interest Group by Dynamics 365 Commerce has moved from Yammer to Viva Engage. If you don't have access to the new Viva Engage community, fill out this form (https://aka.ms/JoinD365commerceVivaEngageCommunity) to be added and stay engaged in the latest discussions.

This article covers the module view file in Microsoft Dynamics 365 Commerce.

A module view file is a TypeScript (.ts) file that controls a module's view. It's called from the module's React component. Additional module views can be provided in various themes to render a module differently, depending on the requirements of the theme.

Example

The following example shows the default module view file for a new module.

import * as React from 'react';
import { IProductFeatureViewProps } from './product-feature';

export default (props: IProductFeatureViewProps) => {
    return (
        <div className='row'>
            <h2>Config Value: {props.config.showText}</h2>
            <h2>Resource Value: {props.resources.resourceKey}</h2>
        </div>
    );
};

Additional resources

Modules overview

Module definition file

Module React component file

Module data file

Module mock file

Module test file

Module props.autogenerated.ts file