Skip to content

React Overlays do not work as documented #538

Open
@sandalwoodbox

Description

@sandalwoodbox

According to https://github.com/projectfluent/fluent.js/wiki/React-Overlays, I should be able to do the following:

<Localized
    id="create-account"
    elems={{
        confirm: <button onClick={() => {console.log('hi')}}></button>,
        cancel: <a href="/"></a>
    }}
>
    <p>{'<confirm>Create account</confirm> or <cancel>go back</cancel>.'}</p>
</Localized>

And have it be rendered as:

<p>
    <button onClick={createAccount}>Create account</button> or <Link to="/">go back</Link>.
</p>

However, instead, it is rendered as:

<p>&lt;confirm&gt;Create account&lt;/confirm&gt; or &lt;cancel&gt;go back&lt;/cancel&gt;.</p>

Version: @fluent/react 0.13.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions