software-mansion / software-mansion/react-native-enriched-html
[Feature request] Add optional attributes parameter to setImage #615
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 1.4k
- Forks
- 66
- Avg merge
- 4d 19h
- Merged PRs (30d)
- 11
Description
Description
Hi! Thanks for the awesome library.
I noticed that setMention supports an optional attributes?: Record<string, string> parameter, which is super useful. However, setImage currently doesn't support this.
Use Case
I need to distinguish between different types of images in my application (e.g., distinguishing a standard user-uploaded image from a custom system sticker/emoji, or adding custom layout metadata like align: center).
Having an attributes parameter in setImage would allow us to pass custom metadata seamlessly.
Proposed API
setImage: (
src: string,
width: number,
height: number,
attributes?: Record<string, string> // <-- Add this
) => void;
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the setImage and setMention definitions and their usages in the React Native library, then compare how the optional attributes parameter is represented. Update setImage so callers can provide the proposed string-keyed attributes and verify that the metadata is accepted and preserved consistently with setMention.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- mobile-dev
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 70/100