Skip to content

Translate property of jsx element #145

@boetn

Description

@boetn

Hi, I just started using your library and it has been great so far. I do have a feature request / "can I do this question".

I was trying to assign a translated text to the placeholder property of an input element. however I can't seem to get it working.

const placeholder = <Translate id={'search'} />;

return (
     <input type="text" className="form-control" placeholder={placeholder} />
);

This however shows a [object] [Object] placeholder since an object is returned. Is there any way I can accomplish this without moving my complete input element to my translation file?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions