Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@fluentui/react-jsx-runtime
Advanced tools
Custom JSX runtime for @fluentui/react-components
React JSX runtime for Fluent UI React
Fluent UI React requires the usage of a custom JSX runtime to support the slots API
[!NOTE] This custom JSX pragma should only be used in cases where you are trying to use the internal Fluent UI React slot API in conjunction with
assertSlots()
.If you are not using the internal slot API, don't use it.
In case you want to re-compose a component and redeclare its render method then this API will be necessary, learn more on Rendering a component with slots
To properly render a component with slots, our custom createElement
method needs to be used instead of default React.createElement
:
NOTE: It works with both
automatic
orclassic
jsxRuntime configuration.
infers
@jsxRuntime automatic
/** @jsxImportSource @fluentui/react-jsx-runtime */
import { assertSlots } from '@fluentui/react-utilities';
const renderButton_unstable = (state: ButtonState) => {
const { iconOnly, iconPosition } = state;
assertSlots<ButtonSlots>(state);
return (
<state.root>
{iconPosition !== 'after' && state.icon && <state.icon />}
{!iconOnly && state.root.children}
{iconPosition === 'after' && state.icon && <state.icon />}
</state.root>
);
};
infers
@jsxRuntime classic
/** @jsx createElement */
// in order to apply our custom `createElement` factory to jsx transforms, to support slot creation, we need to import it physically
import { createElement } from '@fluentui/react-jsx-runtime';
import { assertSlots } from '@fluentui/react-utilities';
const renderButton_unstable = (state: ButtonState) => {
const { iconOnly, iconPosition } = state;
assertSlots<ButtonSlots>(state);
return (
<state.root>
{iconPosition !== 'after' && state.icon && <state.icon />}
{!iconOnly && state.root.children}
{iconPosition === 'after' && state.icon && <state.icon />}
</state.root>
);
};
FAQs
Custom JSX runtime for @fluentui/react-components
The npm package @fluentui/react-jsx-runtime receives a total of 105,499 weekly downloads. As such, @fluentui/react-jsx-runtime popularity was classified as popular.
We found that @fluentui/react-jsx-runtime demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 12 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.