diff --git a/ReactCommon/fabric/attributedstring/AttributedString.cpp b/ReactCommon/fabric/attributedstring/AttributedString.cpp index 01ae1188b25..7d872e65e9c 100644 --- a/ReactCommon/fabric/attributedstring/AttributedString.cpp +++ b/ReactCommon/fabric/attributedstring/AttributedString.cpp @@ -82,7 +82,11 @@ void AttributedString::prependAttributedString( attributedString.fragments_.end()); } -const Fragments &AttributedString::getFragments() const { +Fragments const &AttributedString::getFragments() const { + return fragments_; +} + +Fragments &AttributedString::getFragments() { return fragments_; } diff --git a/ReactCommon/fabric/attributedstring/AttributedString.h b/ReactCommon/fabric/attributedstring/AttributedString.h index c6b07edd714..9da9d2f260e 100644 --- a/ReactCommon/fabric/attributedstring/AttributedString.h +++ b/ReactCommon/fabric/attributedstring/AttributedString.h @@ -73,9 +73,14 @@ class AttributedString : public Sealable, public DebugStringConvertible { void prependAttributedString(const AttributedString &attributedString); /* - * Returns read-only reference to a list of fragments. + * Returns a read-only reference to a list of fragments. */ - const Fragments &getFragments() const; + Fragments const &getFragments() const; + + /* + * Returns a reference to a list of fragments. + */ + Fragments &getFragments(); /* * Returns a string constructed from all strings in all fragments.