@mbsks/rspfx-framework-react
v0.0.15
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. Replaces Heft + webpack + gulp. Works with Vite, Rsbuild, and Rspack.
Provides the ReactWebPart base class with fast refresh: Rspack via @rspack/plugin-react-refresh, Vite via @vitejs/plugin-react, Rsbuild via its React plugin — same FrameworkPreset works with all three bundlers (rspfxVite / rspfxRsbuild / RSpfxPlugin).
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
- Documentation — Frameworks · Fast Refresh
- React example · Vite React · Rsbuild React
- GitHub
- License: MIT
