Files
react-native-config/Example/windows/ConfigExample/App.cpp
T

44 lines
1.2 KiB
C++
Raw Normal View History

2020-09-16 16:28:13 +02:00
#include "pch.h"
#include "App.h"
#include "AutolinkedNativeModules.g.h"
#include "ReactPackageProvider.h"
using namespace winrt::ConfigExample;
using namespace winrt::ConfigExample::implementation;
/// <summary>
/// Initializes the singleton application object. This is the first line of
/// authored code executed, and as such is the logical equivalent of main() or
/// WinMain().
/// </summary>
App::App() noexcept
{
MainComponentName(L"Example");
#if BUNDLE
JavaScriptBundleFile(L"index.windows");
InstanceSettings().UseWebDebugger(false);
InstanceSettings().UseFastRefresh(false);
#else
JavaScriptMainModuleName(L"index");
InstanceSettings().UseWebDebugger(true);
InstanceSettings().UseFastRefresh(true);
#endif
#if _DEBUG
InstanceSettings().EnableDeveloperMenu(true);
#else
InstanceSettings().EnableDeveloperMenu(false);
#endif
RegisterAutolinkedNativeModulePackages(PackageProviders()); // Includes any autolinked modules
PackageProviders().Append(make<ReactPackageProvider>()); // Includes all modules in this project
PackageProviders().Append(winrt::RNCConfig::ReactPackageProvider());
InitializeComponent();
}