A list of recommended libraries that are commonly used inside WFP.
When you are migration from the original WFP UI-Kit to WFP Bridge you will need to consider the following breaking changes:
This approach is recommended for new projects or projects that are in the early stages of development.
Recommended for existing projects that are already using the original WFP UI-Kit. It allows you to migrate to WFP Bridge incrementally, one component at a time and allows you to use the original WFP UI-Kit and WFP Bridge together in the same project.
Design changes
The overall design of components is currently in progress. Please be aware that the design is subject to change.
The @wfp/ui package has been split up into multiple packages like @wfp/react and @wfp/styles.
// Beforeimport { Component } from "@wfp/ui";// After: Replace @wfp/ui with @wfp/react for React componentsimport { Component } from "@wfp/react";
// Before@import '@wfp/react/scss/globals/scss/styles.scss';// After: importing stylesbecomes `@import '@wfp/styles';
More information about importing styles can be found here.
//Before<Icon icon={iconName} />;// After: Each Icon is now a separate component and can be imported directly from the package:import { IconName } from "@wfp/icons-react";<IconName />;
Make sure to look at the usage Icons documentation.
$ui-01 becomes $layer to provide better readability. A full list can be found hereinputRefinputRef is deprecated. Use ref instead.// Before<Input inputRef={yourRef} />// After<Input ref={yourRef} />
Some components are not yet available in WFP Bridge.
ContentSwitcherDoes no longer accept kind = danger--primary, danger--secondary or tertiary.
// Before<Button kind="danger--primary" />// After<Button kind="danger" />
// Before<Button kind="tertiary" />// After<Button kind="secondary" />
Does no longer accept a function inside <MainNavigation /> to handle the click event.
Instead, use the useMainNavigation hook instead.
This is to make the component more flexible and to allow for better customization.
// Before<MainNavigation>{({ onClick }) => (<a onClick={toggleMenu}>Toogle Menu</a>)}</MainNavigation>// After<MainNavigation><YourComponent /></MainNavigation>// Inside YourComponentfunction YourComponent() {const { toggleMenu } = useMainNavigation();return (<a onClick={toggleMenu}>Toogle Menu</a>)}
TODO: Add breaking changes