fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

How to use office-ui-fabric-react Dialog

Open russgove opened this issue 9 years ago • 7 comments

Hi, I copy and pasted the sample code into my own spfx webpart:

<Dialog
     isOpen={ !this.state.hideNewRequestDialog }
       onDismiss={ this._closeDialog }
       dialogContentProps={ {
         type: DialogType.normal,
         title: "All emails together",
         subText: "Your Inbox has changed. No longer does it include favorites, it is a singular destination for your emails."
       } }
       modalProps={ {
         isBlocking: true,
         containerClassName: "ms-dialogMainOverride"
       } }
     >

I get an error saying Property 'dialogContentProps' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes

& IDialogProps & { children?: ReactNode; }'.

What am I doing wrong? are there other samples of this somewhere?

russgove avatar Oct 28 '17 00:10 russgove

anybody got any ideas on this?

russgove avatar Oct 28 '17 00:10 russgove

@russgove What version of Fabric are you using? I was able to recreate the docs site example without error

erichdev avatar Oct 28 '17 00:10 erichdev

i'm using 2.34.21. that's the version that comes with spfx

russgove avatar Oct 29 '17 21:10 russgove

Which version of Typescript are you running? There was a need to adapt fabric to work with the current version of TS some time ago. If you are on Typescript 2.4 or higher i would recommend you to try if it works with Typescript 2.2. (and then you can try to move onwards slightly).

As you are bound to specific versions of modules in spfx, you have also to be stick on the typescript version that your modules support.

LeopoldLerch avatar Nov 02 '17 11:11 LeopoldLerch

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions to Fabric React!

stale[bot] avatar Apr 11 '18 07:04 stale[bot]

Hi @russgove. did this issue get fixed for you? The error makes me feel you are using a react prop that is not a prop on the Dialog React component. This could be because the documentation you read is from the Fabric site and is for a different version of Fabric React than included in your package.

manishgarg1 avatar May 01 '18 20:05 manishgarg1

thanks for following through. i lost track of the issue so closing

russgove avatar May 01 '18 23:05 russgove