In progress...
Procedure
- Install the package Semantic-UI-React. The Semantic UI stylesheet reference will be use as now.
- Import the elements you need from the semantic-ui-react package:
- Search the current UI Element/Collection/View/... used in the Semantic UI Documentation from the className value.
- Search in the Sermantic UI React Documentation the corresponding Element/Collection/View/...
Take into account that some style attributes of the components should be pass as props to the new react component. Searching among the examples in the documentation can help you to detect which ones. For example:
code{/*semantic ui element*/} <div className="ui inverted blue menu"><div> --> {/*Equivalent Semantic-UI-REact element*/} import {Menu} from 'semantic-ui-react'; <Menu inverted="true" color="blue" secondary>
Add the aria-labels and data tooltip attributes to the elements. For example, for a button:
{/*semantic ui element*/} <button class="ui button" type="button" aria-label='Click Here' data-tooltp='Click Here'> Click Here</button> {/*Equivalent Semantic-UI-React element*/} import React from 'react'; import { Button } from 'semantic-ui-react'; <Button aria-label='Click Here' data-tooltp='Click Here'> Click Here </Button>
- Check the final rendered HTML. Some times is a little diferent, and perhaps you should retouch it a litte. For example:
Possible Strategies
Use Semantic-UI and Semantic-UI-React elements together
I've checked it is possible to use both types of components together. So, it could be possible create new elements using Semantic-UI-React elements, and recode previous elements step by step when we have enough time.
Use only Semantic-UI-React elements
In that case, it should be necessary recode all our components, one by one, changing semantic UI elements to Semantic UI React elements, following the steps explained in section Procedure.
Problems
- It is possible we have some problems due to our lack of consistency using semantic-ui and html elements, for example:
- Some buttons added as <button>
- Some buttons added as <div>
- Some buttons added as <NavLink>
Thus sometimes, perhaps will be difficult to us select the mos appropiate in order to get the same final layout
Thus, perhaps will be difficult to us select the most appropriate element in order to get the same final layout