Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(react-text): adopt custom JSX pragma #27626

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: adopt custom JSX pragma",
"packageName": "@fluentui/react-text",
"email": "bernardo.sunderhus@gmail.com",
"dependentChangeType": "patch"
}
1 change: 1 addition & 0 deletions packages/react-components/react-text/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@fluentui/react-theme": "^9.1.7",
"@griffel/react": "^1.5.2",
"@fluentui/react-utilities": "^9.8.0",
"@fluentui/react-jsx-runtime": "9.0.0-alpha.1",
"@swc/helpers": "^0.4.14"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import * as React from 'react';
import { getSlots } from '@fluentui/react-utilities';
/** @jsxRuntime classic */
/** @jsx createElement */

import { createElement } from '@fluentui/react-jsx-runtime';

import { getSlotsNext } from '@fluentui/react-utilities';
import type { TextSlots, TextState } from './Text.types';

/**
* Render the final JSX of Text
*/
export const renderText_unstable = (state: TextState) => {
const { slots, slotProps } = getSlots<TextSlots>(state);
const { slots, slotProps } = getSlotsNext<TextSlots>(state);

return <slots.root {...slotProps.root} />;
};