mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
fix the tsx -> js markdown
This commit is contained in:
@@ -21,7 +21,7 @@ There are some predefined themes within Fabric already, like Fluent (which will
|
|||||||
|
|
||||||
The following code (simplified from `demo/src/components/TodoApp.tsx`) shows an example of applying the Fluent theme to our todo app using `Customizer`.
|
The following code (simplified from `demo/src/components/TodoApp.tsx`) shows an example of applying the Fluent theme to our todo app using `Customizer`.
|
||||||
|
|
||||||
```tsx
|
```js
|
||||||
import { Customizer } from 'office-ui-fabric-react';
|
import { Customizer } from 'office-ui-fabric-react';
|
||||||
import { FluentCustomizations } from '@uifabric/fluent-theme';
|
import { FluentCustomizations } from '@uifabric/fluent-theme';
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ The `styles` prop can take either an object, or a function which returns a style
|
|||||||
|
|
||||||
The following code (simplified from `demo/src/components/TodoHeader.tsx`) demonstrates using `styles` to customize individual components. The TextField uses a style function and the PrimaryButton uses a style object.
|
The following code (simplified from `demo/src/components/TodoHeader.tsx`) demonstrates using `styles` to customize individual components. The TextField uses a style function and the PrimaryButton uses a style object.
|
||||||
|
|
||||||
```ts
|
```js
|
||||||
function render() {
|
function render() {
|
||||||
const buttonStyles = {
|
const buttonStyles = {
|
||||||
root: { backgroundColor: 'maroon' },
|
root: { backgroundColor: 'maroon' },
|
||||||
@@ -128,7 +128,7 @@ Benefits of `mergeStyles` include:
|
|||||||
|
|
||||||
The following is a basic example using mergeStyles. ([This CodePen](https://codepen.io/dzearing/pen/jGdgrE?editors=1011) illustrates in more detail what `mergeStyles` does and includes some advanced examples.)
|
The following is a basic example using mergeStyles. ([This CodePen](https://codepen.io/dzearing/pen/jGdgrE?editors=1011) illustrates in more detail what `mergeStyles` does and includes some advanced examples.)
|
||||||
|
|
||||||
```tsx
|
```js
|
||||||
// can also import from office-ui-fabric-react in Fabric-based apps
|
// can also import from office-ui-fabric-react in Fabric-based apps
|
||||||
import { mergeStyles } from '@uifabric/merge-styles';
|
import { mergeStyles } from '@uifabric/merge-styles';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user