Skip to content

Commit

Permalink
fix: Fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed Jan 16, 2025
1 parent a9427ae commit d3b9e54
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/nitrogen/src/views/CppHybridViewComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function createViewComponentShadowNodeFiles(
)
}

const name = getHybridObjectName(spec.name)
const { T, HybridT } = getHybridObjectName(spec.name)
const {
propsClassName,
stateClassName,
Expand Down Expand Up @@ -89,7 +89,7 @@ namespace ${namespace} {
/**
* The name of the actual native View.
*/
extern const char ${nameVariable}[] = "${name.T}";
extern const char ${nameVariable}[] = "${T}";
/**
* Props for the "${spec.name}" View.
Expand Down Expand Up @@ -127,7 +127,7 @@ namespace ${namespace} {
/**
* The Shadow Node for the "${spec.name}" View.
*/
using ${shadowNodeClassName} = react::ConcreteViewShadowNode<${nameVariable} /* "${name.HybridT}" */,
using ${shadowNodeClassName} = react::ConcreteViewShadowNode<${nameVariable} /* "${HybridT}" */,
${shadowIndent} ${propsClassName} /* custom props */,
${shadowIndent} react::ViewEventEmitter /* default */,
${shadowIndent} ${stateClassName} /* custom state */>;
Expand All @@ -148,7 +148,7 @@ namespace ${namespace} {
} // namespace ${namespace}
#else
#warning "View Component '${name.HybridT}' will be unavailable in React Native, because it requires React Native 78 or higher."
#warning "View Component '${HybridT}' will be unavailable in React Native, because it requires React Native 78 or higher."
#endif
`.trim()

Expand Down Expand Up @@ -181,7 +181,14 @@ ${name}([&]() -> CachedProp<${type}> {
${createFileMetadataString(`${component}.cpp`)}
#include "${component}.hpp"
#include <string>
#include <exception>
#include <utility>
#include <NitroModules/JSIConverter.hpp>
#include <react/renderer/core/RawValue.h>
#include <react/renderer/core/ShadowNode.h>
#include <react/renderer/core/ComponentDescriptor.h>
#include <react/renderer/components/view/ViewProps.h>
#if REACT_NATIVE_VERSION >= 78
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
///

#include "HybridTestViewComponent.hpp"
#include <string>
#include <exception>
#include <utility>
#include <NitroModules/JSIConverter.hpp>
#include <react/renderer/core/RawValue.h>
#include <react/renderer/core/ShadowNode.h>
#include <react/renderer/core/ComponentDescriptor.h>
#include <react/renderer/components/view/ViewProps.h>

#if REACT_NATIVE_VERSION >= 78

Expand Down

0 comments on commit d3b9e54

Please sign in to comment.