Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
Add spellcheck -> spellCheck mapping to documentation to account for a…
Browse files Browse the repository at this point in the history
  • Loading branch information
andymantell committed Jul 30, 2020
1 parent 5c8cfea commit 0484eb4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Exceptions to the conformance with govuk-frontend nunjucks params are as follows
- Header links - `homepageUrl` and `serviceUrl` become `homepageUrlHref` / `homepageUrlTo` and `serviceUrlHref` / `serviceUrlTo`, with the `To` variants being passed to a react-router `<Link>` the `Href` variants being a plain html `<a>` tag
- Anywhere that accepts an `html` or `text` param in Nunjucks will instead accept a `children` prop which should be passed either a string, or JSX. Params such as `summaryText` or `summaryHtml` become `summaryChildren`
- `classes` becomes `className`
- `spellcheck` becomes `spellCheck`
- `describedBy` becomes `aria-describedby`
- List keys - Anywhere that you specify an array of items such as a list of links, you may optionally specify a `reactListKey` for each item. This will be used instead of the index when doing `.map` over the items. React uses these keys internally to work out whether to re-render items. This is crucial for dynamic components where you might re-sort the list items for example. For static data it is less important and the key can be omitted. (See https://reactjs.org/docs/lists-and-keys.html#keys for more)
(_The only exception to this rule is the tab component, where the tabs are already sufficiently keyed by id_)
Expand Down
1 change: 1 addition & 0 deletions utils/processExampleData.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const propReplacements = {
inputmode: 'inputMode',
serviceUrl: 'serviceUrlHref',
homepageUrl: 'homepageUrlHref',
spellcheck: 'spellCheck',
};

export default function processExampleData(data, componentName) {
Expand Down

0 comments on commit 0484eb4

Please sign in to comment.