pointfreeco / swift-composable-architecture

A library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind.
https://www.pointfree.co/collections/composable-architecture
MIT License
12.35k stars 1.44k forks source link

Display this error message to console When using TCA with SwiftUI. #3304

Closed eunryu93 closed 1 month ago

eunryu93 commented 1 month ago

Description

Display this error message to console When using TCA with SwiftUI.

Display this error message to console When using TCA with SwiftUI, I think it have problem tca using swiftui rendering.

I question to chatgpt and google, this problem is said to occur because the value of observableState is not properly passed to SwiftUI's UI.

Can I check this Problem? or, I would appreciate it if you could tell me a solution to this problem.

Attach Screenshot And Console Message.

Checklist

Expected behavior

Not Displayed Error Message.

Actual behavior

Console Message : Perceptible state was accessed but is not being tracked. Track changes to state by wrapping your view in a 'WithPerceptionTracking' view.

I not showed, when had using only state annotation. but, I showed this message, when using tca and using WithViewStore function.

I checked pre issue and I found similarly this issue. The issue is solved and attach answer, vanila swift problem. However, I thought this issue might be different from the previous one, so I would like to ask for your confirmation on this issue.

Thank you.

Steps to reproduce

I'm attaching a part of my code.

var tabManager: StoreOf

var body: some View {
    WithViewStore(tabManager, observe: {$0}) { viewStore in

     VStack(spacing: 1) {

            Rectangle().fill(.brown)
                .frame(height: viewStore.state.refreshViewHeight)

..... }

The Composable Architecture version information

1.13.0

Destination operating system

iOS 15 higher

Xcode version information

15.1

Swift Compiler version information

swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
Target: arm64-apple-macosx14.0

Develope Enviroment:
iOS : iOS 15 higher
Xcode : 15.1
Mac OS : sonoma 14.5
Using swiftUI and SPM
mbrandonw commented 1 month ago

Hi @eunryu93, there unfortunately is not enough information in this report for us to be able to help. Can you please provide a minimal project that demonstrates the problem for us to look at?

Also I am going to convert this to a discussion because it is not clear it is an issue with the library. Please feel free to continue the conversation over there.