Skip to content

Commit

Permalink
chore: adopt custom jsx pragma
Browse files Browse the repository at this point in the history
  • Loading branch information
bsunderhus committed Apr 14, 2023
1 parent d2f17a3 commit 6376fb5
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "chore: adopt custom jsx pragma",
"packageName": "@fluentui/react-tree",
"email": "bernardo.sunderhus@gmail.com",
"dependentChangeType": "patch"
}
1 change: 1 addition & 0 deletions packages/react-components/react-tree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"@fluentui/react-tabster": "^9.6.4",
"@fluentui/react-theme": "^9.1.7",
"@fluentui/react-utilities": "^9.7.4",
"@fluentui/react-jsx-runtime": "^9.0.0-alpha.0",
"@griffel/react": "^1.5.2",
"@swc/helpers": "^0.4.14"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import * as React from 'react';
import { getSlots } from '@fluentui/react-utilities';
/* eslint-disable jsdoc/check-tag-names */
/** @jsxRuntime classic */
/** @jsx createElement */
/* eslint-enable jsdoc/check-tag-names */

import { createElement } from '@fluentui/react-jsx-runtime';
import { getSlotsNext } from '@fluentui/react-utilities';
import type { TreeState, TreeSlots, TreeContextValues } from './Tree.types';
import { TreeProvider } from '../../contexts';

export const renderTree_unstable = (state: TreeState, contextValues: TreeContextValues) => {
const { slots, slotProps } = getSlots<TreeSlots>(state);
const { slots, slotProps } = getSlotsNext<TreeSlots>(state);

return (
<TreeProvider value={contextValues.tree}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import * as React from 'react';
import { getSlots } from '@fluentui/react-utilities';
/* eslint-disable jsdoc/check-tag-names */
/** @jsxRuntime classic */
/** @jsx createElement */
/* eslint-enable jsdoc/check-tag-names */

import { createElement } from '@fluentui/react-jsx-runtime';
import { getSlotsNext } from '@fluentui/react-utilities';
import type { TreeItemState, TreeItemSlots, TreeItemContextValues } from './TreeItem.types';
import { TreeItemProvider } from '../../contexts';
import { ButtonContextProvider } from '@fluentui/react-button';
Expand All @@ -8,7 +13,7 @@ import { ButtonContextProvider } from '@fluentui/react-button';
* Render the final JSX of TreeItem
*/
export const renderTreeItem_unstable = (state: TreeItemState, contextValues: TreeItemContextValues) => {
const { slots, slotProps } = getSlots<TreeItemSlots>(state);
const { slots, slotProps } = getSlotsNext<TreeItemSlots>(state);

return (
<TreeItemProvider value={contextValues.treeItem}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import * as React from 'react';
import { getSlots } from '@fluentui/react-utilities';
/* eslint-disable jsdoc/check-tag-names */
/** @jsxRuntime classic */
/** @jsx createElement */
/* eslint-enable jsdoc/check-tag-names */

import { createElement } from '@fluentui/react-jsx-runtime';
import { getSlotsNext } from '@fluentui/react-utilities';
import type { TreeItemLayoutState, TreeItemLayoutSlots } from './TreeItemLayout.types';

/**
* Render the final JSX of TreeItemLayout
*/
export const renderTreeItemLayout_unstable = (state: TreeItemLayoutState) => {
const { isActionsVisible } = state;
const { slots, slotProps } = getSlots<TreeItemLayoutSlots>(state);
const { slots, slotProps } = getSlotsNext<TreeItemLayoutSlots>(state);
return (
<slots.root {...slotProps.root}>
{slots.iconBefore && <slots.iconBefore {...slotProps.iconBefore} />}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import * as React from 'react';
import { getSlots } from '@fluentui/react-utilities';
/* eslint-disable jsdoc/check-tag-names */
/** @jsxRuntime classic */
/** @jsx createElement */
/* eslint-enable jsdoc/check-tag-names */

import { createElement } from '@fluentui/react-jsx-runtime';
import { getSlotsNext } from '@fluentui/react-utilities';
import type {
TreeItemPersonaLayoutState,
TreeItemPersonaLayoutSlots,
Expand All @@ -15,7 +20,7 @@ export const renderTreeItemPersonaLayout_unstable = (
contextValues: TreeItemPersonaLayoutContextValues,
) => {
const { isActionsVisible } = state;
const { slots, slotProps } = getSlots<TreeItemPersonaLayoutSlots>(state);
const { slots, slotProps } = getSlotsNext<TreeItemPersonaLayoutSlots>(state);

return (
<slots.root {...slotProps.root}>
Expand Down

0 comments on commit 6376fb5

Please sign in to comment.