@mbsks/rspfx-framework-react
v0.0.13
Published
RSPFX React framework preset and web part base class
Readme
@mbsks/rspfx-framework-react
React framework package for RSPFX — an SPFx-compatible build toolchain powered by Rspack.
Provides the ReactWebPart base class with fast refresh support via @rspack/plugin-react-refresh.
Install
npm i @mbsks/rspfx-framework-reactRequires react and react-dom ^18 as peer dependencies.
Usage
import { ReactWebPart } from '@mbsks/rspfx-framework-react/webpart';
import { preset } from '@mbsks/rspfx-framework-react';
import type { ReactElement } from 'react';
interface IMyProps { description: string; }
export default class MyWebPart extends ReactWebPart<IMyProps> {
protected renderComponent(props: IMyProps): ReactElement {
// return your React element using props
return null as unknown as ReactElement;
}
}API
ReactWebPart— base web part class (from@mbsks/rspfx-framework-react/webpart)preset—FrameworkPresetcompiler contributions (from the package index)
Links
- RSPFX documentation
- React example
- License: MIT
