File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/react-sandpack/src/components/SandpackProvider Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -23,14 +23,16 @@ export interface Props {
2323 width ?: number | string ;
2424 height ?: number | string ;
2525 bundlerURL ?: string ;
26- skipEval : boolean ;
26+ skipEval ? : boolean ;
2727 template ?:
2828 | 'create-react-app'
2929 | 'create-react-app-typescript'
3030 | 'parcel'
3131 | 'vue-cli'
3232 | 'angular-cli'
3333 | 'preact-cli' ;
34+
35+ onFileChange ?: ( files : IFiles ) => void ;
3436}
3537
3638export default class SandpackProvider extends React . PureComponent <
@@ -133,6 +135,9 @@ export default class SandpackProvider extends React.PureComponent<
133135 updateFiles = ( files : IFiles ) => {
134136 this . setState ( { files } ) ;
135137
138+ if ( this . props . onFileChange ) {
139+ this . props . onFileChange ( files ) ;
140+ }
136141 if ( this . manager ) {
137142 this . manager . updatePreview ( { files, template : this . props . template } ) ;
138143 }
You can’t perform that action at this time.
0 commit comments