mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add sample component with state in RNTester (#34909)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/34909 This Diff introduces a Sample component in RNTester which uses the NativeState to load some images. It is an example on how to use CustomNativeState In this first diff, I focused on the iOS side of things. The next diff will make this work with Android. ## Changelog [iOS][Added] - Introduce sample component which work with the native state. Reviewed By: cortinico Differential Revision: D39884926 fbshipit-source-id: 9323d751fd06a1bb8ff93af836d97010c2095833
This commit is contained in:
1 parent
d7c41361dd
commit
1a9cceb20b
14 files changed
+520
-2
No files matched your search
@@ -0,0 +1,38 @@
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
require "json"
|
||||
|
||||
package = JSON.parse(File.read(File.join(__dir__, "../" "package.json")))
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "NativeComponentWithState"
|
||||
s.version = package["version"]
|
||||
s.summary = package["description"]
|
||||
s.description = "native-component-with-state"
|
||||
s.homepage = "https://github.com/sota000/my-native-view.git"
|
||||
s.license = "MIT"
|
||||
s.platforms = { :ios => "12.4", :tvos => "12.4" }
|
||||
s.compiler_flags = '-Wno-documentation -Wno-nullability-completeness'
|
||||
s.author = "Facebook, Inc. and its affiliates"
|
||||
s.source = { :git => "https://github.com/facebook/my-native-view.git", :tag => "#{s.version}" }
|
||||
s.pod_target_xcconfig = {
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/boost\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\"",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
||||
}
|
||||
|
||||
s.source_files = "ios/**/*.{h,m,mm,cpp}"
|
||||
s.requires_arc = true
|
||||
|
||||
install_modules_dependencies(s)
|
||||
|
||||
# Enable codegen for this library
|
||||
use_react_native_codegen!(s, {
|
||||
:library_name => "NativeComponentWithStateSpec",
|
||||
:react_native_path => "../../../",
|
||||
:js_srcs_dir => "./js",
|
||||
:library_type => "components"
|
||||
})
|
||||
end
|
||||
Reference in new issue
Block a user