Skip to content

mergeInto show console warning about pure object #22308

Closed
@vreality64

Description

@vreality64

Environment

Run react-native info in your terminal and paste its contents here.

Description

code in mergeInto has potential error about Object created by Object.create(null). they does not have Object.prototype chain, so two.hasOwnProperty shows following error.

object created by null parameter

I'm facing this issue with react-native-extended-stylesheet and FlatList. FlatList has two style property (style, contentContainerStyle). I think these two styles are merged into one by mergeInto.

Environment

[skip envinfo]. The code was written 4 years ago, so I think it's affected on all RN environments.

Reproducible Demo

Sorry, doesn't have demo.

Suggestions

two.hasOwnProperty(key) should be Object.prototype.hasOwnProperty.call(two, key). this makes all thing works well. 😃

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions